001 002package com.commercetools.history.models.common; 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.fasterxml.jackson.annotation.*; 013import com.fasterxml.jackson.databind.annotation.*; 014 015import io.vrap.rmf.base.client.utils.Generated; 016 017/** 018 * TextLineItem 019 * 020 * <hr> 021 * Example to create an instance using the builder pattern 022 * <div class=code-example> 023 * <pre><code class='java'> 024 * TextLineItem textLineItem = TextLineItem.builder() 025 * .addedAt("{addedAt}") 026 * .custom(customBuilder -> customBuilder) 027 * .description(descriptionBuilder -> descriptionBuilder) 028 * .id("{id}") 029 * .name(nameBuilder -> nameBuilder) 030 * .quantity(1) 031 * .build() 032 * </code></pre> 033 * </div> 034 */ 035@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 036@JsonDeserialize(as = TextLineItemImpl.class) 037public interface TextLineItem { 038 039 /** 040 * 041 * @return addedAt 042 */ 043 @NotNull 044 @JsonProperty("addedAt") 045 public String getAddedAt(); 046 047 /** 048 * 049 * @return custom 050 */ 051 @NotNull 052 @Valid 053 @JsonProperty("custom") 054 public CustomFields getCustom(); 055 056 /** 057 * 058 * @return description 059 */ 060 @NotNull 061 @Valid 062 @JsonProperty("description") 063 public LocalizedString getDescription(); 064 065 /** 066 * 067 * @return id 068 */ 069 @NotNull 070 @JsonProperty("id") 071 public String getId(); 072 073 /** 074 * 075 * @return name 076 */ 077 @NotNull 078 @Valid 079 @JsonProperty("name") 080 public LocalizedString getName(); 081 082 /** 083 * 084 * @return quantity 085 */ 086 @NotNull 087 @JsonProperty("quantity") 088 public Integer getQuantity(); 089 090 /** 091 * set addedAt 092 * @param addedAt value to be set 093 */ 094 095 public void setAddedAt(final String addedAt); 096 097 /** 098 * set custom 099 * @param custom value to be set 100 */ 101 102 public void setCustom(final CustomFields custom); 103 104 /** 105 * set description 106 * @param description value to be set 107 */ 108 109 public void setDescription(final LocalizedString description); 110 111 /** 112 * set id 113 * @param id value to be set 114 */ 115 116 public void setId(final String id); 117 118 /** 119 * set name 120 * @param name value to be set 121 */ 122 123 public void setName(final LocalizedString name); 124 125 /** 126 * set quantity 127 * @param quantity value to be set 128 */ 129 130 public void setQuantity(final Integer quantity); 131 132 /** 133 * factory method 134 * @return instance of TextLineItem 135 */ 136 public static TextLineItem of() { 137 return new TextLineItemImpl(); 138 } 139 140 /** 141 * factory method to create a shallow copy TextLineItem 142 * @param template instance to be copied 143 * @return copy instance 144 */ 145 public static TextLineItem of(final TextLineItem template) { 146 TextLineItemImpl instance = new TextLineItemImpl(); 147 instance.setAddedAt(template.getAddedAt()); 148 instance.setCustom(template.getCustom()); 149 instance.setDescription(template.getDescription()); 150 instance.setId(template.getId()); 151 instance.setName(template.getName()); 152 instance.setQuantity(template.getQuantity()); 153 return instance; 154 } 155 156 /** 157 * factory method to create a deep copy of TextLineItem 158 * @param template instance to be copied 159 * @return copy instance 160 */ 161 @Nullable 162 public static TextLineItem deepCopy(@Nullable final TextLineItem template) { 163 if (template == null) { 164 return null; 165 } 166 TextLineItemImpl instance = new TextLineItemImpl(); 167 instance.setAddedAt(template.getAddedAt()); 168 instance.setCustom(com.commercetools.history.models.common.CustomFields.deepCopy(template.getCustom())); 169 instance.setDescription( 170 com.commercetools.history.models.common.LocalizedString.deepCopy(template.getDescription())); 171 instance.setId(template.getId()); 172 instance.setName(com.commercetools.history.models.common.LocalizedString.deepCopy(template.getName())); 173 instance.setQuantity(template.getQuantity()); 174 return instance; 175 } 176 177 /** 178 * builder factory method for TextLineItem 179 * @return builder 180 */ 181 public static TextLineItemBuilder builder() { 182 return TextLineItemBuilder.of(); 183 } 184 185 /** 186 * create builder for TextLineItem instance 187 * @param template instance with prefilled values for the builder 188 * @return builder 189 */ 190 public static TextLineItemBuilder builder(final TextLineItem template) { 191 return TextLineItemBuilder.of(template); 192 } 193 194 /** 195 * accessor map function 196 * @param <T> mapped type 197 * @param helper function to map the object 198 * @return mapped value 199 */ 200 default <T> T withTextLineItem(Function<TextLineItem, T> helper) { 201 return helper.apply(this); 202 } 203 204 /** 205 * gives a TypeReference for usage with Jackson DataBind 206 * @return TypeReference 207 */ 208 public static com.fasterxml.jackson.core.type.TypeReference<TextLineItem> typeReference() { 209 return new com.fasterxml.jackson.core.type.TypeReference<TextLineItem>() { 210 @Override 211 public String toString() { 212 return "TypeReference<TextLineItem>"; 213 } 214 }; 215 } 216}