001//@formatter:off 002/* 003 * Address - entity in the first subsystem 004 * Code-Beispiel zum Buch Patterns Kompakt, Verlag Springer Vieweg 005 * Copyright 2014 Karl Eilebrecht 006 * 007 * Licensed under the Apache License, Version 2.0 (the "License"): 008 * you may not use this file except in compliance with the License. 009 * You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, software 014 * distributed under the License is distributed on an "AS IS" BASIS, 015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 016 * See the License for the specific language governing permissions and 017 * limitations under the License. 018 */ 019//@formatter:on 020package de.calamanari.pk.mapper.firstsys; 021 022/** 023 * Address - entity in the first subsystem 024 * 025 * @author <a href="mailto:Karl.Eilebrecht(a/t)calamanari.de">Karl Eilebrecht</a> 026 */ 027public class Address { 028 029 /** 030 * ID of person this address belongs to 031 */ 032 private String personId = null; 033 034 /** 035 * street 036 */ 037 private String street = null; 038 039 /** 040 * Zip code 041 */ 042 private String zipCode = null; 043 044 /** 045 * city 046 */ 047 private String city = null; 048 049 /** 050 * Creates address for a person 051 * 052 * @param personId identifier 053 * @param street address field 054 * @param zipCode address field 055 * @param city address field 056 */ 057 public Address(String personId, String street, String zipCode, String city) { 058 this.personId = personId; 059 this.city = city; 060 this.street = street; 061 this.zipCode = zipCode; 062 } 063 064 /** 065 * Returns id of person, this address belongs to 066 * 067 * @return personId 068 */ 069 public String getPersonId() { 070 return personId; 071 } 072 073 /** 074 * Returns the street address of customer 075 * 076 * @return street 077 */ 078 public String getStreet() { 079 return street; 080 } 081 082 /** 083 * Sets the street of the customer 084 * 085 * @param street address field 086 */ 087 public void setStreet(String street) { 088 this.street = street; 089 } 090 091 /** 092 * Returns the zip-code of the customer 093 * 094 * @return zipCode 095 */ 096 public String getZipCode() { 097 return zipCode; 098 } 099 100 /** 101 * Sets the zip-code of the customer 102 * 103 * @param zipCode address field 104 */ 105 public void setZipCode(String zipCode) { 106 this.zipCode = zipCode; 107 } 108 109 /** 110 * Returns the city of the customer 111 * 112 * @return city 113 */ 114 public String getCity() { 115 return city; 116 } 117 118 /** 119 * Sets the city of the customer 120 * 121 * @param city address field 122 */ 123 public void setCity(String city) { 124 this.city = city; 125 } 126 127 @Override 128 public String toString() { 129 return this.getClass().getSimpleName() + "({personId=" + personId + ", street=" + street + ", zipCode=" + zipCode + ", city=" + city + "})"; 130 } 131 132}