001//@formatter:off
002/*
003 * Customer - entity in the second 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.secondsys;
021
022/**
023 * Customer - entity in the second subsystem
024 * 
025 * @author <a href="mailto:Karl.Eilebrecht(a/t)calamanari.de">Karl Eilebrecht</a>
026 */
027public class Customer {
028
029    /**
030     * id of customer
031     */
032    private String customerId = null;
033
034    /**
035     * last name
036     */
037    private String lastName = null;
038
039    /**
040     * first name
041     */
042    private String firstName = null;
043
044    /**
045     * customer lifetime in days
046     */
047    private int customerLifeTimeDays = 0;
048
049    /**
050     * street
051     */
052    private String street = null;
053
054    /**
055     * Zip code
056     */
057    private String zipCode = null;
058
059    /**
060     * city
061     */
062    private String city = null;
063
064    /**
065     * Creates customer
066     * 
067     * @param customerId identifier
068     */
069    public Customer(String customerId) {
070        this.customerId = customerId;
071    }
072
073    /**
074     * Returns id of customer
075     * 
076     * @return customerId
077     */
078    public String getCustomerId() {
079        return customerId;
080    }
081
082    /**
083     * Returns the customer's lifetime in days
084     * 
085     * @return customerLifeTimeDays
086     */
087    public int getCustomerLifeTimeDays() {
088        return customerLifeTimeDays;
089    }
090
091    /**
092     * Sets the customer lifetime in days
093     * 
094     * @param customerLifeTimeDays time in day since date of birth
095     */
096    public void setCustomerLifeTimeDays(int customerLifeTimeDays) {
097        this.customerLifeTimeDays = customerLifeTimeDays;
098    }
099
100    /**
101     * Returns the customer's last name
102     * 
103     * @return last name of customer
104     */
105    public String getLastName() {
106        return lastName;
107    }
108
109    /**
110     * Sets the last name of customer
111     * 
112     * @param lastName person's last name
113     */
114    public void setLastName(String lastName) {
115        this.lastName = lastName;
116    }
117
118    /**
119     * Returns the first name of the customer
120     * 
121     * @return firstName
122     */
123    public String getFirstName() {
124        return firstName;
125    }
126
127    /**
128     * Sets the first name of the customer
129     * 
130     * @param firstName person's first name
131     */
132    public void setFirstName(String firstName) {
133        this.firstName = firstName;
134    }
135
136    /**
137     * Returns the street address of customer
138     * 
139     * @return street
140     */
141    public String getStreet() {
142        return street;
143    }
144
145    /**
146     * Sets the street of the customer
147     * 
148     * @param street address field
149     */
150    public void setStreet(String street) {
151        this.street = street;
152    }
153
154    /**
155     * Returns the zip-code of the customer
156     * 
157     * @return zipCode
158     */
159    public String getZipCode() {
160        return zipCode;
161    }
162
163    /**
164     * Sets the zip-code of the customer
165     * 
166     * @param zipCode address field
167     */
168    public void setZipCode(String zipCode) {
169        this.zipCode = zipCode;
170    }
171
172    /**
173     * Returns the city of the customer
174     * 
175     * @return city
176     */
177    public String getCity() {
178        return city;
179    }
180
181    /**
182     * Sets the city of the customer
183     * 
184     * @param city address field
185     */
186    public void setCity(String city) {
187        this.city = city;
188    }
189
190    @Override
191    public String toString() {
192        return this.getClass().getSimpleName() + "({customerId=" + customerId + ", lastName=" + lastName + ", firstName=" + firstName
193                + ", customerLifeTimeDays=" + customerLifeTimeDays + ", street=" + street + ", zipCode=" + zipCode + ", city=" + city + "})";
194    }
195
196}