001
002package com.commercetools.history.models.label;
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 * CustomerLabel
018 *
019 * <hr>
020 * Example to create an instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     CustomerLabel customerLabel = CustomerLabel.builder()
024 *             .firstName("{firstName}")
025 *             .lastName("{lastName}")
026 *             .customerNumber("{customerNumber}")
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 = CustomerLabelImpl.class)
033public interface CustomerLabel extends Label {
034
035    /**
036     * discriminator value for CustomerLabel
037     */
038    String CUSTOMER_LABEL = "CustomerLabel";
039
040    /**
041     *
042     * @return type
043     */
044    @NotNull
045    @JsonProperty("type")
046    public String getType();
047
048    /**
049     *  <p>Given name (first name) of the Customer.</p>
050     * @return firstName
051     */
052    @NotNull
053    @JsonProperty("firstName")
054    public String getFirstName();
055
056    /**
057     *  <p>Family name (last name) of the Customer.</p>
058     * @return lastName
059     */
060    @NotNull
061    @JsonProperty("lastName")
062    public String getLastName();
063
064    /**
065     *  <p>User-defined unique identifier of the Customer.</p>
066     * @return customerNumber
067     */
068    @NotNull
069    @JsonProperty("customerNumber")
070    public String getCustomerNumber();
071
072    /**
073     *  <p>Given name (first name) of the Customer.</p>
074     * @param firstName value to be set
075     */
076
077    public void setFirstName(final String firstName);
078
079    /**
080     *  <p>Family name (last name) of the Customer.</p>
081     * @param lastName value to be set
082     */
083
084    public void setLastName(final String lastName);
085
086    /**
087     *  <p>User-defined unique identifier of the Customer.</p>
088     * @param customerNumber value to be set
089     */
090
091    public void setCustomerNumber(final String customerNumber);
092
093    /**
094     * factory method
095     * @return instance of CustomerLabel
096     */
097    public static CustomerLabel of() {
098        return new CustomerLabelImpl();
099    }
100
101    /**
102     * factory method to create a shallow copy CustomerLabel
103     * @param template instance to be copied
104     * @return copy instance
105     */
106    public static CustomerLabel of(final CustomerLabel template) {
107        CustomerLabelImpl instance = new CustomerLabelImpl();
108        instance.setFirstName(template.getFirstName());
109        instance.setLastName(template.getLastName());
110        instance.setCustomerNumber(template.getCustomerNumber());
111        return instance;
112    }
113
114    /**
115     * factory method to create a deep copy of CustomerLabel
116     * @param template instance to be copied
117     * @return copy instance
118     */
119    @Nullable
120    public static CustomerLabel deepCopy(@Nullable final CustomerLabel template) {
121        if (template == null) {
122            return null;
123        }
124        CustomerLabelImpl instance = new CustomerLabelImpl();
125        instance.setFirstName(template.getFirstName());
126        instance.setLastName(template.getLastName());
127        instance.setCustomerNumber(template.getCustomerNumber());
128        return instance;
129    }
130
131    /**
132     * builder factory method for CustomerLabel
133     * @return builder
134     */
135    public static CustomerLabelBuilder builder() {
136        return CustomerLabelBuilder.of();
137    }
138
139    /**
140     * create builder for CustomerLabel instance
141     * @param template instance with prefilled values for the builder
142     * @return builder
143     */
144    public static CustomerLabelBuilder builder(final CustomerLabel template) {
145        return CustomerLabelBuilder.of(template);
146    }
147
148    /**
149     * accessor map function
150     * @param <T> mapped type
151     * @param helper function to map the object
152     * @return mapped value
153     */
154    default <T> T withCustomerLabel(Function<CustomerLabel, T> helper) {
155        return helper.apply(this);
156    }
157
158    /**
159     * gives a TypeReference for usage with Jackson DataBind
160     * @return TypeReference
161     */
162    public static com.fasterxml.jackson.core.type.TypeReference<CustomerLabel> typeReference() {
163        return new com.fasterxml.jackson.core.type.TypeReference<CustomerLabel>() {
164            @Override
165            public String toString() {
166                return "TypeReference<CustomerLabel>";
167            }
168        };
169    }
170}