001
002package com.commercetools.ml.models.common;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import com.fasterxml.jackson.annotation.*;
009import com.fasterxml.jackson.databind.annotation.*;
010
011import io.vrap.rmf.base.client.utils.Generated;
012
013/**
014 * ProductTypeReference
015 *
016 * <hr>
017 * Example to create an instance using the builder pattern
018 * <div class=code-example>
019 * <pre><code class='java'>
020 *     ProductTypeReference productTypeReference = ProductTypeReference.builder()
021 *             .id("{id}")
022 *             .build()
023 * </code></pre>
024 * </div>
025 */
026@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
027@JsonDeserialize(as = ProductTypeReferenceImpl.class)
028public interface ProductTypeReference extends Reference {
029
030    String PRODUCT_TYPE = "product-type";
031
032    public static ProductTypeReference of() {
033        return new ProductTypeReferenceImpl();
034    }
035
036    public static ProductTypeReference of(final ProductTypeReference template) {
037        ProductTypeReferenceImpl instance = new ProductTypeReferenceImpl();
038        instance.setId(template.getId());
039        return instance;
040    }
041
042    public static ProductTypeReferenceBuilder builder() {
043        return ProductTypeReferenceBuilder.of();
044    }
045
046    public static ProductTypeReferenceBuilder builder(final ProductTypeReference template) {
047        return ProductTypeReferenceBuilder.of(template);
048    }
049
050    default <T> T withProductTypeReference(Function<ProductTypeReference, T> helper) {
051        return helper.apply(this);
052    }
053
054    public static com.fasterxml.jackson.core.type.TypeReference<ProductTypeReference> typeReference() {
055        return new com.fasterxml.jackson.core.type.TypeReference<ProductTypeReference>() {
056            @Override
057            public String toString() {
058                return "TypeReference<ProductTypeReference>";
059            }
060        };
061    }
062}