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