001
002package com.commercetools.importapi.models.customfields;
003
004import java.time.*;
005import java.time.LocalTime;
006import java.util.*;
007import java.util.function.Function;
008
009import javax.annotation.Nullable;
010import javax.validation.constraints.NotNull;
011
012import com.fasterxml.jackson.annotation.*;
013import com.fasterxml.jackson.databind.annotation.*;
014
015import io.vrap.rmf.base.client.utils.Generated;
016
017/**
018 *  <p>A field with a time value.</p>
019 *
020 * <hr>
021 * Example to create an instance using the builder pattern
022 * <div class=code-example>
023 * <pre><code class='java'>
024 *     TimeField timeField = TimeField.builder()
025 *             .value(LocalTime.parse("12:00:00.301"))
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 = TimeFieldImpl.class)
032public interface TimeField extends CustomField {
033
034    /**
035     * discriminator value for TimeField
036     */
037    String TIME = "Time";
038
039    /**
040     *
041     * @return value
042     */
043    @NotNull
044    @JsonProperty("value")
045    public LocalTime getValue();
046
047    /**
048     * set value
049     * @param value value to be set
050     */
051
052    public void setValue(final LocalTime value);
053
054    /**
055     * factory method
056     * @return instance of TimeField
057     */
058    public static TimeField of() {
059        return new TimeFieldImpl();
060    }
061
062    /**
063     * factory method to create a shallow copy TimeField
064     * @param template instance to be copied
065     * @return copy instance
066     */
067    public static TimeField of(final TimeField template) {
068        TimeFieldImpl instance = new TimeFieldImpl();
069        instance.setValue(template.getValue());
070        return instance;
071    }
072
073    /**
074     * factory method to create a deep copy of TimeField
075     * @param template instance to be copied
076     * @return copy instance
077     */
078    @Nullable
079    public static TimeField deepCopy(@Nullable final TimeField template) {
080        if (template == null) {
081            return null;
082        }
083        TimeFieldImpl instance = new TimeFieldImpl();
084        instance.setValue(template.getValue());
085        return instance;
086    }
087
088    /**
089     * builder factory method for TimeField
090     * @return builder
091     */
092    public static TimeFieldBuilder builder() {
093        return TimeFieldBuilder.of();
094    }
095
096    /**
097     * create builder for TimeField instance
098     * @param template instance with prefilled values for the builder
099     * @return builder
100     */
101    public static TimeFieldBuilder builder(final TimeField template) {
102        return TimeFieldBuilder.of(template);
103    }
104
105    /**
106     * accessor map function
107     * @param <T> mapped type
108     * @param helper function to map the object
109     * @return mapped value
110     */
111    default <T> T withTimeField(Function<TimeField, T> helper) {
112        return helper.apply(this);
113    }
114
115    /**
116     * gives a TypeReference for usage with Jackson DataBind
117     * @return TypeReference
118     */
119    public static com.fasterxml.jackson.core.type.TypeReference<TimeField> typeReference() {
120        return new com.fasterxml.jackson.core.type.TypeReference<TimeField>() {
121            @Override
122            public String toString() {
123                return "TypeReference<TimeField>";
124            }
125        };
126    }
127}