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 * ProductReference 015 * 016 * <hr> 017 * Example to create an instance using the builder pattern 018 * <div class=code-example> 019 * <pre><code class='java'> 020 * ProductReference productReference = ProductReference.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 = ProductReferenceImpl.class) 028public interface ProductReference extends Reference { 029 030 String PRODUCT = "product"; 031 032 public static ProductReference of() { 033 return new ProductReferenceImpl(); 034 } 035 036 public static ProductReference of(final ProductReference template) { 037 ProductReferenceImpl instance = new ProductReferenceImpl(); 038 instance.setId(template.getId()); 039 return instance; 040 } 041 042 public static ProductReferenceBuilder builder() { 043 return ProductReferenceBuilder.of(); 044 } 045 046 public static ProductReferenceBuilder builder(final ProductReference template) { 047 return ProductReferenceBuilder.of(template); 048 } 049 050 default <T> T withProductReference(Function<ProductReference, T> helper) { 051 return helper.apply(this); 052 } 053 054 public static com.fasterxml.jackson.core.type.TypeReference<ProductReference> typeReference() { 055 return new com.fasterxml.jackson.core.type.TypeReference<ProductReference>() { 056 @Override 057 public String toString() { 058 return "TypeReference<ProductReference>"; 059 } 060 }; 061 } 062}