001
002package com.commercetools.history.models.common;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009import javax.validation.constraints.NotNull;
010
011import com.fasterxml.jackson.annotation.*;
012import com.fasterxml.jackson.databind.annotation.*;
013
014import io.vrap.rmf.base.client.utils.Generated;
015
016/**
017 * Address
018 *
019 * <hr>
020 * Example to create an instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     Address address = Address.builder()
024 *             .id("{id}")
025 *             .key("{key}")
026 *             .title("{title}")
027 *             .salutation("{salutation}")
028 *             .firstName("{firstName}")
029 *             .lastName("{lastName}")
030 *             .streetName("{streetName}")
031 *             .streetNumber("{streetNumber}")
032 *             .additionalStreetInfo("{additionalStreetInfo}")
033 *             .postalCode("{postalCode}")
034 *             .city("{city}")
035 *             .region("{region}")
036 *             .state("{state}")
037 *             .country("{country}")
038 *             .company("{company}")
039 *             .department("{department}")
040 *             .building("{building}")
041 *             .apartment("{apartment}")
042 *             .pOBox("{pOBox}")
043 *             .phone("{phone}")
044 *             .mobile("{mobile}")
045 *             .email("{email}")
046 *             .fax("{fax}")
047 *             .additionalAddressInfo("{additionalAddressInfo}")
048 *             .externalId("{externalId}")
049 *             .build()
050 * </code></pre>
051 * </div>
052 */
053@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
054@JsonDeserialize(as = AddressImpl.class)
055public interface Address {
056
057    /**
058     *  <p>Unique ID of the Address.</p>
059     * @return id
060     */
061    @NotNull
062    @JsonProperty("id")
063    public String getId();
064
065    /**
066     *
067     * @return key
068     */
069    @NotNull
070    @JsonProperty("key")
071    public String getKey();
072
073    /**
074     *
075     * @return title
076     */
077    @NotNull
078    @JsonProperty("title")
079    public String getTitle();
080
081    /**
082     *
083     * @return salutation
084     */
085    @NotNull
086    @JsonProperty("salutation")
087    public String getSalutation();
088
089    /**
090     *
091     * @return firstName
092     */
093    @NotNull
094    @JsonProperty("firstName")
095    public String getFirstName();
096
097    /**
098     *
099     * @return lastName
100     */
101    @NotNull
102    @JsonProperty("lastName")
103    public String getLastName();
104
105    /**
106     *
107     * @return streetName
108     */
109    @NotNull
110    @JsonProperty("streetName")
111    public String getStreetName();
112
113    /**
114     *
115     * @return streetNumber
116     */
117    @NotNull
118    @JsonProperty("streetNumber")
119    public String getStreetNumber();
120
121    /**
122     *
123     * @return additionalStreetInfo
124     */
125    @NotNull
126    @JsonProperty("additionalStreetInfo")
127    public String getAdditionalStreetInfo();
128
129    /**
130     *
131     * @return postalCode
132     */
133    @NotNull
134    @JsonProperty("postalCode")
135    public String getPostalCode();
136
137    /**
138     *
139     * @return city
140     */
141    @NotNull
142    @JsonProperty("city")
143    public String getCity();
144
145    /**
146     *
147     * @return region
148     */
149    @NotNull
150    @JsonProperty("region")
151    public String getRegion();
152
153    /**
154     *
155     * @return state
156     */
157    @NotNull
158    @JsonProperty("state")
159    public String getState();
160
161    /**
162     *  <p>Two-digit country code as per ISO 3166-1 alpha-2.</p>
163     * @return country
164     */
165    @NotNull
166    @JsonProperty("country")
167    public String getCountry();
168
169    /**
170     *
171     * @return company
172     */
173    @NotNull
174    @JsonProperty("company")
175    public String getCompany();
176
177    /**
178     *
179     * @return department
180     */
181    @NotNull
182    @JsonProperty("department")
183    public String getDepartment();
184
185    /**
186     *
187     * @return building
188     */
189    @NotNull
190    @JsonProperty("building")
191    public String getBuilding();
192
193    /**
194     *
195     * @return apartment
196     */
197    @NotNull
198    @JsonProperty("apartment")
199    public String getApartment();
200
201    /**
202     *
203     * @return pOBox
204     */
205    @NotNull
206    @JsonProperty("pOBox")
207    public String getPOBox();
208
209    /**
210     *
211     * @return phone
212     */
213    @NotNull
214    @JsonProperty("phone")
215    public String getPhone();
216
217    /**
218     *
219     * @return mobile
220     */
221    @NotNull
222    @JsonProperty("mobile")
223    public String getMobile();
224
225    /**
226     *
227     * @return email
228     */
229    @NotNull
230    @JsonProperty("email")
231    public String getEmail();
232
233    /**
234     *
235     * @return fax
236     */
237    @NotNull
238    @JsonProperty("fax")
239    public String getFax();
240
241    /**
242     *
243     * @return additionalAddressInfo
244     */
245    @NotNull
246    @JsonProperty("additionalAddressInfo")
247    public String getAdditionalAddressInfo();
248
249    /**
250     *
251     * @return externalId
252     */
253    @NotNull
254    @JsonProperty("externalId")
255    public String getExternalId();
256
257    /**
258     *  <p>Unique ID of the Address.</p>
259     * @param id value to be set
260     */
261
262    public void setId(final String id);
263
264    /**
265     * set key
266     * @param key value to be set
267     */
268
269    public void setKey(final String key);
270
271    /**
272     * set title
273     * @param title value to be set
274     */
275
276    public void setTitle(final String title);
277
278    /**
279     * set salutation
280     * @param salutation value to be set
281     */
282
283    public void setSalutation(final String salutation);
284
285    /**
286     * set firstName
287     * @param firstName value to be set
288     */
289
290    public void setFirstName(final String firstName);
291
292    /**
293     * set lastName
294     * @param lastName value to be set
295     */
296
297    public void setLastName(final String lastName);
298
299    /**
300     * set streetName
301     * @param streetName value to be set
302     */
303
304    public void setStreetName(final String streetName);
305
306    /**
307     * set streetNumber
308     * @param streetNumber value to be set
309     */
310
311    public void setStreetNumber(final String streetNumber);
312
313    /**
314     * set additionalStreetInfo
315     * @param additionalStreetInfo value to be set
316     */
317
318    public void setAdditionalStreetInfo(final String additionalStreetInfo);
319
320    /**
321     * set postalCode
322     * @param postalCode value to be set
323     */
324
325    public void setPostalCode(final String postalCode);
326
327    /**
328     * set city
329     * @param city value to be set
330     */
331
332    public void setCity(final String city);
333
334    /**
335     * set region
336     * @param region value to be set
337     */
338
339    public void setRegion(final String region);
340
341    /**
342     * set state
343     * @param state value to be set
344     */
345
346    public void setState(final String state);
347
348    /**
349     *  <p>Two-digit country code as per ISO 3166-1 alpha-2.</p>
350     * @param country value to be set
351     */
352
353    public void setCountry(final String country);
354
355    /**
356     * set company
357     * @param company value to be set
358     */
359
360    public void setCompany(final String company);
361
362    /**
363     * set department
364     * @param department value to be set
365     */
366
367    public void setDepartment(final String department);
368
369    /**
370     * set building
371     * @param building value to be set
372     */
373
374    public void setBuilding(final String building);
375
376    /**
377     * set apartment
378     * @param apartment value to be set
379     */
380
381    public void setApartment(final String apartment);
382
383    /**
384     * set pOBox
385     * @param pOBox value to be set
386     */
387
388    public void setPOBox(final String pOBox);
389
390    /**
391     * set phone
392     * @param phone value to be set
393     */
394
395    public void setPhone(final String phone);
396
397    /**
398     * set mobile
399     * @param mobile value to be set
400     */
401
402    public void setMobile(final String mobile);
403
404    /**
405     * set email
406     * @param email value to be set
407     */
408
409    public void setEmail(final String email);
410
411    /**
412     * set fax
413     * @param fax value to be set
414     */
415
416    public void setFax(final String fax);
417
418    /**
419     * set additionalAddressInfo
420     * @param additionalAddressInfo value to be set
421     */
422
423    public void setAdditionalAddressInfo(final String additionalAddressInfo);
424
425    /**
426     * set externalId
427     * @param externalId value to be set
428     */
429
430    public void setExternalId(final String externalId);
431
432    /**
433     * factory method
434     * @return instance of Address
435     */
436    public static Address of() {
437        return new AddressImpl();
438    }
439
440    /**
441     * factory method to create a shallow copy Address
442     * @param template instance to be copied
443     * @return copy instance
444     */
445    public static Address of(final Address template) {
446        AddressImpl instance = new AddressImpl();
447        instance.setId(template.getId());
448        instance.setKey(template.getKey());
449        instance.setTitle(template.getTitle());
450        instance.setSalutation(template.getSalutation());
451        instance.setFirstName(template.getFirstName());
452        instance.setLastName(template.getLastName());
453        instance.setStreetName(template.getStreetName());
454        instance.setStreetNumber(template.getStreetNumber());
455        instance.setAdditionalStreetInfo(template.getAdditionalStreetInfo());
456        instance.setPostalCode(template.getPostalCode());
457        instance.setCity(template.getCity());
458        instance.setRegion(template.getRegion());
459        instance.setState(template.getState());
460        instance.setCountry(template.getCountry());
461        instance.setCompany(template.getCompany());
462        instance.setDepartment(template.getDepartment());
463        instance.setBuilding(template.getBuilding());
464        instance.setApartment(template.getApartment());
465        instance.setPOBox(template.getPOBox());
466        instance.setPhone(template.getPhone());
467        instance.setMobile(template.getMobile());
468        instance.setEmail(template.getEmail());
469        instance.setFax(template.getFax());
470        instance.setAdditionalAddressInfo(template.getAdditionalAddressInfo());
471        instance.setExternalId(template.getExternalId());
472        return instance;
473    }
474
475    /**
476     * factory method to create a deep copy of Address
477     * @param template instance to be copied
478     * @return copy instance
479     */
480    @Nullable
481    public static Address deepCopy(@Nullable final Address template) {
482        if (template == null) {
483            return null;
484        }
485        AddressImpl instance = new AddressImpl();
486        instance.setId(template.getId());
487        instance.setKey(template.getKey());
488        instance.setTitle(template.getTitle());
489        instance.setSalutation(template.getSalutation());
490        instance.setFirstName(template.getFirstName());
491        instance.setLastName(template.getLastName());
492        instance.setStreetName(template.getStreetName());
493        instance.setStreetNumber(template.getStreetNumber());
494        instance.setAdditionalStreetInfo(template.getAdditionalStreetInfo());
495        instance.setPostalCode(template.getPostalCode());
496        instance.setCity(template.getCity());
497        instance.setRegion(template.getRegion());
498        instance.setState(template.getState());
499        instance.setCountry(template.getCountry());
500        instance.setCompany(template.getCompany());
501        instance.setDepartment(template.getDepartment());
502        instance.setBuilding(template.getBuilding());
503        instance.setApartment(template.getApartment());
504        instance.setPOBox(template.getPOBox());
505        instance.setPhone(template.getPhone());
506        instance.setMobile(template.getMobile());
507        instance.setEmail(template.getEmail());
508        instance.setFax(template.getFax());
509        instance.setAdditionalAddressInfo(template.getAdditionalAddressInfo());
510        instance.setExternalId(template.getExternalId());
511        return instance;
512    }
513
514    /**
515     * builder factory method for Address
516     * @return builder
517     */
518    public static AddressBuilder builder() {
519        return AddressBuilder.of();
520    }
521
522    /**
523     * create builder for Address instance
524     * @param template instance with prefilled values for the builder
525     * @return builder
526     */
527    public static AddressBuilder builder(final Address template) {
528        return AddressBuilder.of(template);
529    }
530
531    /**
532     * accessor map function
533     * @param <T> mapped type
534     * @param helper function to map the object
535     * @return mapped value
536     */
537    default <T> T withAddress(Function<Address, T> helper) {
538        return helper.apply(this);
539    }
540
541    /**
542     * gives a TypeReference for usage with Jackson DataBind
543     * @return TypeReference
544     */
545    public static com.fasterxml.jackson.core.type.TypeReference<Address> typeReference() {
546        return new com.fasterxml.jackson.core.type.TypeReference<Address>() {
547            @Override
548            public String toString() {
549                return "TypeReference<Address>";
550            }
551        };
552    }
553}