001
002package com.commercetools.api.models.order;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009
010import com.fasterxml.jackson.annotation.*;
011import com.fasterxml.jackson.databind.annotation.*;
012
013import io.vrap.rmf.base.client.utils.Generated;
014
015/**
016 * TrackingData
017 *
018 * <hr>
019 * Example to create an instance using the builder pattern
020 * <div class=code-example>
021 * <pre><code class='java'>
022 *     TrackingData trackingData = TrackingData.builder()
023 *             .build()
024 * </code></pre>
025 * </div>
026 */
027@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
028@JsonDeserialize(as = TrackingDataImpl.class)
029public interface TrackingData {
030
031    /**
032     *  <p>The ID to track one parcel.</p>
033     * @return trackingId
034     */
035
036    @JsonProperty("trackingId")
037    public String getTrackingId();
038
039    /**
040     *  <p>The carrier that delivers the parcel.</p>
041     * @return carrier
042     */
043
044    @JsonProperty("carrier")
045    public String getCarrier();
046
047    /**
048     *
049     * @return provider
050     */
051
052    @JsonProperty("provider")
053    public String getProvider();
054
055    /**
056     *
057     * @return providerTransaction
058     */
059
060    @JsonProperty("providerTransaction")
061    public String getProviderTransaction();
062
063    /**
064     *  <p>Flag to distinguish if the parcel is on the way to the customer (false) or on the way back (true).</p>
065     * @return isReturn
066     */
067
068    @JsonProperty("isReturn")
069    public Boolean getIsReturn();
070
071    /**
072     *  <p>The ID to track one parcel.</p>
073     * @param trackingId value to be set
074     */
075
076    public void setTrackingId(final String trackingId);
077
078    /**
079     *  <p>The carrier that delivers the parcel.</p>
080     * @param carrier value to be set
081     */
082
083    public void setCarrier(final String carrier);
084
085    /**
086     * set provider
087     * @param provider value to be set
088     */
089
090    public void setProvider(final String provider);
091
092    /**
093     * set providerTransaction
094     * @param providerTransaction value to be set
095     */
096
097    public void setProviderTransaction(final String providerTransaction);
098
099    /**
100     *  <p>Flag to distinguish if the parcel is on the way to the customer (false) or on the way back (true).</p>
101     * @param isReturn value to be set
102     */
103
104    public void setIsReturn(final Boolean isReturn);
105
106    /**
107     * factory method
108     * @return instance of TrackingData
109     */
110    public static TrackingData of() {
111        return new TrackingDataImpl();
112    }
113
114    /**
115     * factory method to create a shallow copy TrackingData
116     * @param template instance to be copied
117     * @return copy instance
118     */
119    public static TrackingData of(final TrackingData template) {
120        TrackingDataImpl instance = new TrackingDataImpl();
121        instance.setTrackingId(template.getTrackingId());
122        instance.setCarrier(template.getCarrier());
123        instance.setProvider(template.getProvider());
124        instance.setProviderTransaction(template.getProviderTransaction());
125        instance.setIsReturn(template.getIsReturn());
126        return instance;
127    }
128
129    /**
130     * factory method to create a deep copy of TrackingData
131     * @param template instance to be copied
132     * @return copy instance
133     */
134    @Nullable
135    public static TrackingData deepCopy(@Nullable final TrackingData template) {
136        if (template == null) {
137            return null;
138        }
139        TrackingDataImpl instance = new TrackingDataImpl();
140        instance.setTrackingId(template.getTrackingId());
141        instance.setCarrier(template.getCarrier());
142        instance.setProvider(template.getProvider());
143        instance.setProviderTransaction(template.getProviderTransaction());
144        instance.setIsReturn(template.getIsReturn());
145        return instance;
146    }
147
148    /**
149     * builder factory method for TrackingData
150     * @return builder
151     */
152    public static TrackingDataBuilder builder() {
153        return TrackingDataBuilder.of();
154    }
155
156    /**
157     * create builder for TrackingData instance
158     * @param template instance with prefilled values for the builder
159     * @return builder
160     */
161    public static TrackingDataBuilder builder(final TrackingData template) {
162        return TrackingDataBuilder.of(template);
163    }
164
165    /**
166     * accessor map function
167     * @param <T> mapped type
168     * @param helper function to map the object
169     * @return mapped value
170     */
171    default <T> T withTrackingData(Function<TrackingData, T> helper) {
172        return helper.apply(this);
173    }
174
175    /**
176     * gives a TypeReference for usage with Jackson DataBind
177     * @return TypeReference
178     */
179    public static com.fasterxml.jackson.core.type.TypeReference<TrackingData> typeReference() {
180        return new com.fasterxml.jackson.core.type.TypeReference<TrackingData>() {
181            @Override
182            public String toString() {
183                return "TypeReference<TrackingData>";
184            }
185        };
186    }
187}