001 002package com.commercetools.api.models.attribute_group; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009import javax.validation.Valid; 010import javax.validation.constraints.NotNull; 011 012import com.commercetools.api.models.common.Reference; 013import com.fasterxml.jackson.annotation.*; 014import com.fasterxml.jackson.databind.annotation.*; 015 016import io.vrap.rmf.base.client.utils.Generated; 017 018/** 019 * <p>Reference to an AttributeGroup.</p> 020 * 021 * <hr> 022 * Example to create an instance using the builder pattern 023 * <div class=code-example> 024 * <pre><code class='java'> 025 * AttributeGroupReference attributeGroupReference = AttributeGroupReference.builder() 026 * .id("{id}") 027 * .build() 028 * </code></pre> 029 * </div> 030 */ 031@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 032@JsonDeserialize(as = AttributeGroupReferenceImpl.class) 033public interface AttributeGroupReference extends Reference, com.commercetools.api.models.Identifiable<AttributeGroup> { 034 035 /** 036 * discriminator value for AttributeGroupReference 037 */ 038 String ATTRIBUTE_GROUP = "attribute-group"; 039 040 /** 041 * <p>Contains the representation of the expanded AttributeGroup. Only present in responses to requests with Reference Expansion for AttributeGroup.</p> 042 * @return obj 043 */ 044 @Valid 045 @JsonProperty("obj") 046 public AttributeGroup getObj(); 047 048 /** 049 * <p>Platform-generated unique identifier of the referenced AttributeGroup.</p> 050 * @return id 051 */ 052 @NotNull 053 @JsonProperty("id") 054 public String getId(); 055 056 /** 057 * <p>Contains the representation of the expanded AttributeGroup. Only present in responses to requests with Reference Expansion for AttributeGroup.</p> 058 * @param obj value to be set 059 */ 060 061 public void setObj(final AttributeGroup obj); 062 063 /** 064 * <p>Platform-generated unique identifier of the referenced AttributeGroup.</p> 065 * @param id value to be set 066 */ 067 068 public void setId(final String id); 069 070 /** 071 * factory method 072 * @return instance of AttributeGroupReference 073 */ 074 public static AttributeGroupReference of() { 075 return new AttributeGroupReferenceImpl(); 076 } 077 078 /** 079 * factory method to create a shallow copy AttributeGroupReference 080 * @param template instance to be copied 081 * @return copy instance 082 */ 083 public static AttributeGroupReference of(final AttributeGroupReference template) { 084 AttributeGroupReferenceImpl instance = new AttributeGroupReferenceImpl(); 085 instance.setId(template.getId()); 086 instance.setObj(template.getObj()); 087 return instance; 088 } 089 090 /** 091 * factory method to create a deep copy of AttributeGroupReference 092 * @param template instance to be copied 093 * @return copy instance 094 */ 095 @Nullable 096 public static AttributeGroupReference deepCopy(@Nullable final AttributeGroupReference template) { 097 if (template == null) { 098 return null; 099 } 100 AttributeGroupReferenceImpl instance = new AttributeGroupReferenceImpl(); 101 instance.setId(template.getId()); 102 instance.setObj(com.commercetools.api.models.attribute_group.AttributeGroup.deepCopy(template.getObj())); 103 return instance; 104 } 105 106 /** 107 * builder factory method for AttributeGroupReference 108 * @return builder 109 */ 110 public static AttributeGroupReferenceBuilder builder() { 111 return AttributeGroupReferenceBuilder.of(); 112 } 113 114 /** 115 * create builder for AttributeGroupReference instance 116 * @param template instance with prefilled values for the builder 117 * @return builder 118 */ 119 public static AttributeGroupReferenceBuilder builder(final AttributeGroupReference template) { 120 return AttributeGroupReferenceBuilder.of(template); 121 } 122 123 /** 124 * accessor map function 125 * @param <T> mapped type 126 * @param helper function to map the object 127 * @return mapped value 128 */ 129 default <T> T withAttributeGroupReference(Function<AttributeGroupReference, T> helper) { 130 return helper.apply(this); 131 } 132 133 /** 134 * gives a TypeReference for usage with Jackson DataBind 135 * @return TypeReference 136 */ 137 public static com.fasterxml.jackson.core.type.TypeReference<AttributeGroupReference> typeReference() { 138 return new com.fasterxml.jackson.core.type.TypeReference<AttributeGroupReference>() { 139 @Override 140 public String toString() { 141 return "TypeReference<AttributeGroupReference>"; 142 } 143 }; 144 } 145}