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 * StoreCountry
018 *
019 * <hr>
020 * Example to create an instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     StoreCountry storeCountry = StoreCountry.builder()
024 *             .code("{code}")
025 *             .build()
026 * </code></pre>
027 * </div>
028 */
029@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
030@JsonDeserialize(as = StoreCountryImpl.class)
031public interface StoreCountry {
032
033    /**
034     *  <p>Two-digit country code as per ISO 3166-1 alpha-2.</p>
035     * @return code
036     */
037    @NotNull
038    @JsonProperty("code")
039    public String getCode();
040
041    /**
042     *  <p>Two-digit country code as per ISO 3166-1 alpha-2.</p>
043     * @param code value to be set
044     */
045
046    public void setCode(final String code);
047
048    /**
049     * factory method
050     * @return instance of StoreCountry
051     */
052    public static StoreCountry of() {
053        return new StoreCountryImpl();
054    }
055
056    /**
057     * factory method to create a shallow copy StoreCountry
058     * @param template instance to be copied
059     * @return copy instance
060     */
061    public static StoreCountry of(final StoreCountry template) {
062        StoreCountryImpl instance = new StoreCountryImpl();
063        instance.setCode(template.getCode());
064        return instance;
065    }
066
067    /**
068     * factory method to create a deep copy of StoreCountry
069     * @param template instance to be copied
070     * @return copy instance
071     */
072    @Nullable
073    public static StoreCountry deepCopy(@Nullable final StoreCountry template) {
074        if (template == null) {
075            return null;
076        }
077        StoreCountryImpl instance = new StoreCountryImpl();
078        instance.setCode(template.getCode());
079        return instance;
080    }
081
082    /**
083     * builder factory method for StoreCountry
084     * @return builder
085     */
086    public static StoreCountryBuilder builder() {
087        return StoreCountryBuilder.of();
088    }
089
090    /**
091     * create builder for StoreCountry instance
092     * @param template instance with prefilled values for the builder
093     * @return builder
094     */
095    public static StoreCountryBuilder builder(final StoreCountry template) {
096        return StoreCountryBuilder.of(template);
097    }
098
099    /**
100     * accessor map function
101     * @param <T> mapped type
102     * @param helper function to map the object
103     * @return mapped value
104     */
105    default <T> T withStoreCountry(Function<StoreCountry, T> helper) {
106        return helper.apply(this);
107    }
108
109    /**
110     * gives a TypeReference for usage with Jackson DataBind
111     * @return TypeReference
112     */
113    public static com.fasterxml.jackson.core.type.TypeReference<StoreCountry> typeReference() {
114        return new com.fasterxml.jackson.core.type.TypeReference<StoreCountry>() {
115            @Override
116            public String toString() {
117                return "TypeReference<StoreCountry>";
118            }
119        };
120    }
121}