001
002package com.commercetools.history.models.change_value;
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 * ValidFromAndUntilValue
018 *
019 * <hr>
020 * Example to create an instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     ValidFromAndUntilValue validFromAndUntilValue = ValidFromAndUntilValue.builder()
024 *             .validFrom("{validFrom}")
025 *             .validUntil("{validUntil}")
026 *             .build()
027 * </code></pre>
028 * </div>
029 */
030@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
031@JsonDeserialize(as = ValidFromAndUntilValueImpl.class)
032public interface ValidFromAndUntilValue {
033
034    /**
035     *  <p>Date and time (UTC) from when the Discount is effective.</p>
036     * @return validFrom
037     */
038    @NotNull
039    @JsonProperty("validFrom")
040    public String getValidFrom();
041
042    /**
043     *  <p>Date and time (UTC) until when the Discount is effective.</p>
044     * @return validUntil
045     */
046    @NotNull
047    @JsonProperty("validUntil")
048    public String getValidUntil();
049
050    /**
051     *  <p>Date and time (UTC) from when the Discount is effective.</p>
052     * @param validFrom value to be set
053     */
054
055    public void setValidFrom(final String validFrom);
056
057    /**
058     *  <p>Date and time (UTC) until when the Discount is effective.</p>
059     * @param validUntil value to be set
060     */
061
062    public void setValidUntil(final String validUntil);
063
064    /**
065     * factory method
066     * @return instance of ValidFromAndUntilValue
067     */
068    public static ValidFromAndUntilValue of() {
069        return new ValidFromAndUntilValueImpl();
070    }
071
072    /**
073     * factory method to create a shallow copy ValidFromAndUntilValue
074     * @param template instance to be copied
075     * @return copy instance
076     */
077    public static ValidFromAndUntilValue of(final ValidFromAndUntilValue template) {
078        ValidFromAndUntilValueImpl instance = new ValidFromAndUntilValueImpl();
079        instance.setValidFrom(template.getValidFrom());
080        instance.setValidUntil(template.getValidUntil());
081        return instance;
082    }
083
084    /**
085     * factory method to create a deep copy of ValidFromAndUntilValue
086     * @param template instance to be copied
087     * @return copy instance
088     */
089    @Nullable
090    public static ValidFromAndUntilValue deepCopy(@Nullable final ValidFromAndUntilValue template) {
091        if (template == null) {
092            return null;
093        }
094        ValidFromAndUntilValueImpl instance = new ValidFromAndUntilValueImpl();
095        instance.setValidFrom(template.getValidFrom());
096        instance.setValidUntil(template.getValidUntil());
097        return instance;
098    }
099
100    /**
101     * builder factory method for ValidFromAndUntilValue
102     * @return builder
103     */
104    public static ValidFromAndUntilValueBuilder builder() {
105        return ValidFromAndUntilValueBuilder.of();
106    }
107
108    /**
109     * create builder for ValidFromAndUntilValue instance
110     * @param template instance with prefilled values for the builder
111     * @return builder
112     */
113    public static ValidFromAndUntilValueBuilder builder(final ValidFromAndUntilValue template) {
114        return ValidFromAndUntilValueBuilder.of(template);
115    }
116
117    /**
118     * accessor map function
119     * @param <T> mapped type
120     * @param helper function to map the object
121     * @return mapped value
122     */
123    default <T> T withValidFromAndUntilValue(Function<ValidFromAndUntilValue, T> helper) {
124        return helper.apply(this);
125    }
126
127    /**
128     * gives a TypeReference for usage with Jackson DataBind
129     * @return TypeReference
130     */
131    public static com.fasterxml.jackson.core.type.TypeReference<ValidFromAndUntilValue> typeReference() {
132        return new com.fasterxml.jackson.core.type.TypeReference<ValidFromAndUntilValue>() {
133            @Override
134            public String toString() {
135                return "TypeReference<ValidFromAndUntilValue>";
136            }
137        };
138    }
139}