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