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