001
002package com.commercetools.ml.models.common;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009
010import com.fasterxml.jackson.annotation.*;
011import com.fasterxml.jackson.databind.annotation.*;
012
013import io.vrap.rmf.base.client.utils.Generated;
014
015/**
016 * ProductTypeReference
017 *
018 * <hr>
019 * Example to create an instance using the builder pattern
020 * <div class=code-example>
021 * <pre><code class='java'>
022 *     ProductTypeReference productTypeReference = ProductTypeReference.builder()
023 *             .id("{id}")
024 *             .build()
025 * </code></pre>
026 * </div>
027 */
028@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
029@JsonDeserialize(as = ProductTypeReferenceImpl.class)
030public interface ProductTypeReference extends Reference {
031
032    /**
033     * discriminator value for ProductTypeReference
034     */
035    String PRODUCT_TYPE = "product-type";
036
037    /**
038     * factory method
039     * @return instance of ProductTypeReference
040     */
041    public static ProductTypeReference of() {
042        return new ProductTypeReferenceImpl();
043    }
044
045    /**
046     * factory method to create a shallow copy ProductTypeReference
047     * @param template instance to be copied
048     * @return copy instance
049     */
050    public static ProductTypeReference of(final ProductTypeReference template) {
051        ProductTypeReferenceImpl instance = new ProductTypeReferenceImpl();
052        instance.setId(template.getId());
053        return instance;
054    }
055
056    /**
057     * factory method to create a deep copy of ProductTypeReference
058     * @param template instance to be copied
059     * @return copy instance
060     */
061    @Nullable
062    public static ProductTypeReference deepCopy(@Nullable final ProductTypeReference template) {
063        if (template == null) {
064            return null;
065        }
066        ProductTypeReferenceImpl instance = new ProductTypeReferenceImpl();
067        instance.setId(template.getId());
068        return instance;
069    }
070
071    /**
072     * builder factory method for ProductTypeReference
073     * @return builder
074     */
075    public static ProductTypeReferenceBuilder builder() {
076        return ProductTypeReferenceBuilder.of();
077    }
078
079    /**
080     * create builder for ProductTypeReference instance
081     * @param template instance with prefilled values for the builder
082     * @return builder
083     */
084    public static ProductTypeReferenceBuilder builder(final ProductTypeReference template) {
085        return ProductTypeReferenceBuilder.of(template);
086    }
087
088    /**
089     * accessor map function
090     * @param <T> mapped type
091     * @param helper function to map the object
092     * @return mapped value
093     */
094    default <T> T withProductTypeReference(Function<ProductTypeReference, T> helper) {
095        return helper.apply(this);
096    }
097
098    /**
099     * gives a TypeReference for usage with Jackson DataBind
100     * @return TypeReference
101     */
102    public static com.fasterxml.jackson.core.type.TypeReference<ProductTypeReference> typeReference() {
103        return new com.fasterxml.jackson.core.type.TypeReference<ProductTypeReference>() {
104            @Override
105            public String toString() {
106                return "TypeReference<ProductTypeReference>";
107            }
108        };
109    }
110}