001 002package com.commercetools.history.models.change_value; 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.history.models.common.LocalizedString; 013import com.fasterxml.jackson.annotation.*; 014import com.fasterxml.jackson.databind.annotation.*; 015 016import io.vrap.rmf.base.client.utils.Generated; 017 018/** 019 * ShoppingListLineItemValue 020 * 021 * <hr> 022 * Example to create an instance using the builder pattern 023 * <div class=code-example> 024 * <pre><code class='java'> 025 * ShoppingListLineItemValue shoppingListLineItemValue = ShoppingListLineItemValue.builder() 026 * .id("{id}") 027 * .name(nameBuilder -> nameBuilder) 028 * .variantId(1) 029 * .build() 030 * </code></pre> 031 * </div> 032 */ 033@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 034@JsonDeserialize(as = ShoppingListLineItemValueImpl.class) 035public interface ShoppingListLineItemValue { 036 037 /** 038 * <p><code>id</code> of the ShoppingListLineItem.</p> 039 * @return id 040 */ 041 @NotNull 042 @JsonProperty("id") 043 public String getId(); 044 045 /** 046 * <p>Name of the corresponding Product the Product Variant belongs to.</p> 047 * @return name 048 */ 049 @NotNull 050 @Valid 051 @JsonProperty("name") 052 public LocalizedString getName(); 053 054 /** 055 * <p><code>id</code> of the ProductVariant the ShoppingListLineItem refers to.</p> 056 * @return variantId 057 */ 058 @NotNull 059 @JsonProperty("variantId") 060 public Integer getVariantId(); 061 062 /** 063 * <p><code>id</code> of the ShoppingListLineItem.</p> 064 * @param id value to be set 065 */ 066 067 public void setId(final String id); 068 069 /** 070 * <p>Name of the corresponding Product the Product Variant belongs to.</p> 071 * @param name value to be set 072 */ 073 074 public void setName(final LocalizedString name); 075 076 /** 077 * <p><code>id</code> of the ProductVariant the ShoppingListLineItem refers to.</p> 078 * @param variantId value to be set 079 */ 080 081 public void setVariantId(final Integer variantId); 082 083 /** 084 * factory method 085 * @return instance of ShoppingListLineItemValue 086 */ 087 public static ShoppingListLineItemValue of() { 088 return new ShoppingListLineItemValueImpl(); 089 } 090 091 /** 092 * factory method to create a shallow copy ShoppingListLineItemValue 093 * @param template instance to be copied 094 * @return copy instance 095 */ 096 public static ShoppingListLineItemValue of(final ShoppingListLineItemValue template) { 097 ShoppingListLineItemValueImpl instance = new ShoppingListLineItemValueImpl(); 098 instance.setId(template.getId()); 099 instance.setName(template.getName()); 100 instance.setVariantId(template.getVariantId()); 101 return instance; 102 } 103 104 /** 105 * factory method to create a deep copy of ShoppingListLineItemValue 106 * @param template instance to be copied 107 * @return copy instance 108 */ 109 @Nullable 110 public static ShoppingListLineItemValue deepCopy(@Nullable final ShoppingListLineItemValue template) { 111 if (template == null) { 112 return null; 113 } 114 ShoppingListLineItemValueImpl instance = new ShoppingListLineItemValueImpl(); 115 instance.setId(template.getId()); 116 instance.setName(com.commercetools.history.models.common.LocalizedString.deepCopy(template.getName())); 117 instance.setVariantId(template.getVariantId()); 118 return instance; 119 } 120 121 /** 122 * builder factory method for ShoppingListLineItemValue 123 * @return builder 124 */ 125 public static ShoppingListLineItemValueBuilder builder() { 126 return ShoppingListLineItemValueBuilder.of(); 127 } 128 129 /** 130 * create builder for ShoppingListLineItemValue instance 131 * @param template instance with prefilled values for the builder 132 * @return builder 133 */ 134 public static ShoppingListLineItemValueBuilder builder(final ShoppingListLineItemValue template) { 135 return ShoppingListLineItemValueBuilder.of(template); 136 } 137 138 /** 139 * accessor map function 140 * @param <T> mapped type 141 * @param helper function to map the object 142 * @return mapped value 143 */ 144 default <T> T withShoppingListLineItemValue(Function<ShoppingListLineItemValue, T> helper) { 145 return helper.apply(this); 146 } 147 148 /** 149 * gives a TypeReference for usage with Jackson DataBind 150 * @return TypeReference 151 */ 152 public static com.fasterxml.jackson.core.type.TypeReference<ShoppingListLineItemValue> typeReference() { 153 return new com.fasterxml.jackson.core.type.TypeReference<ShoppingListLineItemValue>() { 154 @Override 155 public String toString() { 156 return "TypeReference<ShoppingListLineItemValue>"; 157 } 158 }; 159 } 160}