001
002package com.commercetools.api.models.standalone_price;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009import javax.validation.Valid;
010
011import com.commercetools.api.models.common.Reference;
012import com.fasterxml.jackson.annotation.*;
013import com.fasterxml.jackson.databind.annotation.*;
014
015import io.vrap.rmf.base.client.utils.Generated;
016
017/**
018 *  <p>Reference to a StandalonePrice.</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 *     StandalonePriceReference standalonePriceReference = StandalonePriceReference.builder()
025 *             .id("{id}")
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 = StandalonePriceReferenceImpl.class)
032public interface StandalonePriceReference extends Reference {
033
034    /**
035     * discriminator value for StandalonePriceReference
036     */
037    String STANDALONE_PRICE = "standalone-price";
038
039    /**
040     *  <p>Contains the representation of the expanded StandalonePrice. Only present in responses to requests with Reference Expansion for StandalonePrice.</p>
041     * @return obj
042     */
043    @Valid
044    @JsonProperty("obj")
045    public StandalonePrice getObj();
046
047    /**
048     *  <p>Contains the representation of the expanded StandalonePrice. Only present in responses to requests with Reference Expansion for StandalonePrice.</p>
049     * @param obj value to be set
050     */
051
052    public void setObj(final StandalonePrice obj);
053
054    /**
055     * factory method
056     * @return instance of StandalonePriceReference
057     */
058    public static StandalonePriceReference of() {
059        return new StandalonePriceReferenceImpl();
060    }
061
062    /**
063     * factory method to create a shallow copy StandalonePriceReference
064     * @param template instance to be copied
065     * @return copy instance
066     */
067    public static StandalonePriceReference of(final StandalonePriceReference template) {
068        StandalonePriceReferenceImpl instance = new StandalonePriceReferenceImpl();
069        instance.setId(template.getId());
070        instance.setObj(template.getObj());
071        return instance;
072    }
073
074    /**
075     * factory method to create a deep copy of StandalonePriceReference
076     * @param template instance to be copied
077     * @return copy instance
078     */
079    @Nullable
080    public static StandalonePriceReference deepCopy(@Nullable final StandalonePriceReference template) {
081        if (template == null) {
082            return null;
083        }
084        StandalonePriceReferenceImpl instance = new StandalonePriceReferenceImpl();
085        instance.setId(template.getId());
086        instance.setObj(com.commercetools.api.models.standalone_price.StandalonePrice.deepCopy(template.getObj()));
087        return instance;
088    }
089
090    /**
091     * builder factory method for StandalonePriceReference
092     * @return builder
093     */
094    public static StandalonePriceReferenceBuilder builder() {
095        return StandalonePriceReferenceBuilder.of();
096    }
097
098    /**
099     * create builder for StandalonePriceReference instance
100     * @param template instance with prefilled values for the builder
101     * @return builder
102     */
103    public static StandalonePriceReferenceBuilder builder(final StandalonePriceReference template) {
104        return StandalonePriceReferenceBuilder.of(template);
105    }
106
107    /**
108     * accessor map function
109     * @param <T> mapped type
110     * @param helper function to map the object
111     * @return mapped value
112     */
113    default <T> T withStandalonePriceReference(Function<StandalonePriceReference, T> helper) {
114        return helper.apply(this);
115    }
116
117    /**
118     * gives a TypeReference for usage with Jackson DataBind
119     * @return TypeReference
120     */
121    public static com.fasterxml.jackson.core.type.TypeReference<StandalonePriceReference> typeReference() {
122        return new com.fasterxml.jackson.core.type.TypeReference<StandalonePriceReference>() {
123            @Override
124            public String toString() {
125                return "TypeReference<StandalonePriceReference>";
126            }
127        };
128    }
129}