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.constraints.NotNull; 010 011import com.fasterxml.jackson.annotation.*; 012import com.fasterxml.jackson.databind.annotation.*; 013 014import io.vrap.rmf.base.client.utils.Generated; 015 016/** 017 * ReturnItem 018 * 019 * <hr> 020 * Example to create an instance using the builder pattern 021 * <div class=code-example> 022 * <pre><code class='java'> 023 * ReturnItem returnItem = ReturnItem.builder() 024 * .id("{id}") 025 * .quantity(1) 026 * .type("{type}") 027 * .comment("{comment}") 028 * .shipmentState(ReturnShipmentState.ADVISED) 029 * .paymentState(ReturnPaymentState.NON_REFUNDABLE) 030 * .lastModifiedAt("{lastModifiedAt}") 031 * .createdAt("{createdAt}") 032 * .build() 033 * </code></pre> 034 * </div> 035 */ 036@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 037@JsonDeserialize(as = ReturnItemImpl.class) 038public interface ReturnItem { 039 040 /** 041 * 042 * @return id 043 */ 044 @NotNull 045 @JsonProperty("id") 046 public String getId(); 047 048 /** 049 * 050 * @return quantity 051 */ 052 @NotNull 053 @JsonProperty("quantity") 054 public Integer getQuantity(); 055 056 /** 057 * 058 * @return type 059 */ 060 @NotNull 061 @JsonProperty("type") 062 public String getType(); 063 064 /** 065 * 066 * @return comment 067 */ 068 @NotNull 069 @JsonProperty("comment") 070 public String getComment(); 071 072 /** 073 * 074 * @return shipmentState 075 */ 076 @NotNull 077 @JsonProperty("shipmentState") 078 public ReturnShipmentState getShipmentState(); 079 080 /** 081 * 082 * @return paymentState 083 */ 084 @NotNull 085 @JsonProperty("paymentState") 086 public ReturnPaymentState getPaymentState(); 087 088 /** 089 * 090 * @return lastModifiedAt 091 */ 092 @NotNull 093 @JsonProperty("lastModifiedAt") 094 public String getLastModifiedAt(); 095 096 /** 097 * 098 * @return createdAt 099 */ 100 @NotNull 101 @JsonProperty("createdAt") 102 public String getCreatedAt(); 103 104 /** 105 * set id 106 * @param id value to be set 107 */ 108 109 public void setId(final String id); 110 111 /** 112 * set quantity 113 * @param quantity value to be set 114 */ 115 116 public void setQuantity(final Integer quantity); 117 118 /** 119 * set type 120 * @param type value to be set 121 */ 122 123 public void setType(final String type); 124 125 /** 126 * set comment 127 * @param comment value to be set 128 */ 129 130 public void setComment(final String comment); 131 132 /** 133 * set shipmentState 134 * @param shipmentState value to be set 135 */ 136 137 public void setShipmentState(final ReturnShipmentState shipmentState); 138 139 /** 140 * set paymentState 141 * @param paymentState value to be set 142 */ 143 144 public void setPaymentState(final ReturnPaymentState paymentState); 145 146 /** 147 * set lastModifiedAt 148 * @param lastModifiedAt value to be set 149 */ 150 151 public void setLastModifiedAt(final String lastModifiedAt); 152 153 /** 154 * set createdAt 155 * @param createdAt value to be set 156 */ 157 158 public void setCreatedAt(final String createdAt); 159 160 /** 161 * factory method 162 * @return instance of ReturnItem 163 */ 164 public static ReturnItem of() { 165 return new ReturnItemImpl(); 166 } 167 168 /** 169 * factory method to create a shallow copy ReturnItem 170 * @param template instance to be copied 171 * @return copy instance 172 */ 173 public static ReturnItem of(final ReturnItem template) { 174 ReturnItemImpl instance = new ReturnItemImpl(); 175 instance.setId(template.getId()); 176 instance.setQuantity(template.getQuantity()); 177 instance.setType(template.getType()); 178 instance.setComment(template.getComment()); 179 instance.setShipmentState(template.getShipmentState()); 180 instance.setPaymentState(template.getPaymentState()); 181 instance.setLastModifiedAt(template.getLastModifiedAt()); 182 instance.setCreatedAt(template.getCreatedAt()); 183 return instance; 184 } 185 186 /** 187 * factory method to create a deep copy of ReturnItem 188 * @param template instance to be copied 189 * @return copy instance 190 */ 191 @Nullable 192 public static ReturnItem deepCopy(@Nullable final ReturnItem template) { 193 if (template == null) { 194 return null; 195 } 196 ReturnItemImpl instance = new ReturnItemImpl(); 197 instance.setId(template.getId()); 198 instance.setQuantity(template.getQuantity()); 199 instance.setType(template.getType()); 200 instance.setComment(template.getComment()); 201 instance.setShipmentState(template.getShipmentState()); 202 instance.setPaymentState(template.getPaymentState()); 203 instance.setLastModifiedAt(template.getLastModifiedAt()); 204 instance.setCreatedAt(template.getCreatedAt()); 205 return instance; 206 } 207 208 /** 209 * builder factory method for ReturnItem 210 * @return builder 211 */ 212 public static ReturnItemBuilder builder() { 213 return ReturnItemBuilder.of(); 214 } 215 216 /** 217 * create builder for ReturnItem instance 218 * @param template instance with prefilled values for the builder 219 * @return builder 220 */ 221 public static ReturnItemBuilder builder(final ReturnItem template) { 222 return ReturnItemBuilder.of(template); 223 } 224 225 /** 226 * accessor map function 227 * @param <T> mapped type 228 * @param helper function to map the object 229 * @return mapped value 230 */ 231 default <T> T withReturnItem(Function<ReturnItem, T> helper) { 232 return helper.apply(this); 233 } 234 235 /** 236 * gives a TypeReference for usage with Jackson DataBind 237 * @return TypeReference 238 */ 239 public static com.fasterxml.jackson.core.type.TypeReference<ReturnItem> typeReference() { 240 return new com.fasterxml.jackson.core.type.TypeReference<ReturnItem>() { 241 @Override 242 public String toString() { 243 return "TypeReference<ReturnItem>"; 244 } 245 }; 246 } 247}