001
002package com.commercetools.importapi.models.producttypes;
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.commercetools.importapi.models.common.ReferenceType;
012import com.fasterxml.jackson.annotation.*;
013import com.fasterxml.jackson.databind.annotation.*;
014
015import io.vrap.rmf.base.client.utils.Generated;
016
017/**
018 * AttributeReferenceType
019 *
020 * <hr>
021 * Example to create an instance using the builder pattern
022 * <div class=code-example>
023 * <pre><code class='java'>
024 *     AttributeReferenceType attributeReferenceType = AttributeReferenceType.builder()
025 *             .referenceTypeId(ReferenceType.CART)
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 = AttributeReferenceTypeImpl.class)
032public interface AttributeReferenceType extends AttributeType {
033
034    /**
035     * discriminator value for AttributeReferenceType
036     */
037    String REFERENCE = "reference";
038
039    /**
040     *  <p>The type of the referenced resource.</p>
041     * @return referenceTypeId
042     */
043    @NotNull
044    @JsonProperty("referenceTypeId")
045    public ReferenceType getReferenceTypeId();
046
047    /**
048     *  <p>The type of the referenced resource.</p>
049     * @param referenceTypeId value to be set
050     */
051
052    public void setReferenceTypeId(final ReferenceType referenceTypeId);
053
054    /**
055     * factory method
056     * @return instance of AttributeReferenceType
057     */
058    public static AttributeReferenceType of() {
059        return new AttributeReferenceTypeImpl();
060    }
061
062    /**
063     * factory method to create a shallow copy AttributeReferenceType
064     * @param template instance to be copied
065     * @return copy instance
066     */
067    public static AttributeReferenceType of(final AttributeReferenceType template) {
068        AttributeReferenceTypeImpl instance = new AttributeReferenceTypeImpl();
069        instance.setReferenceTypeId(template.getReferenceTypeId());
070        return instance;
071    }
072
073    /**
074     * factory method to create a deep copy of AttributeReferenceType
075     * @param template instance to be copied
076     * @return copy instance
077     */
078    @Nullable
079    public static AttributeReferenceType deepCopy(@Nullable final AttributeReferenceType template) {
080        if (template == null) {
081            return null;
082        }
083        AttributeReferenceTypeImpl instance = new AttributeReferenceTypeImpl();
084        instance.setReferenceTypeId(template.getReferenceTypeId());
085        return instance;
086    }
087
088    /**
089     * builder factory method for AttributeReferenceType
090     * @return builder
091     */
092    public static AttributeReferenceTypeBuilder builder() {
093        return AttributeReferenceTypeBuilder.of();
094    }
095
096    /**
097     * create builder for AttributeReferenceType instance
098     * @param template instance with prefilled values for the builder
099     * @return builder
100     */
101    public static AttributeReferenceTypeBuilder builder(final AttributeReferenceType template) {
102        return AttributeReferenceTypeBuilder.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 withAttributeReferenceType(Function<AttributeReferenceType, 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<AttributeReferenceType> typeReference() {
120        return new com.fasterxml.jackson.core.type.TypeReference<AttributeReferenceType>() {
121            @Override
122            public String toString() {
123                return "TypeReference<AttributeReferenceType>";
124            }
125        };
126    }
127}