001 002package com.commercetools.api.models.shopping_list; 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 * ShoppingListChangeTextLineItemQuantityAction 018 * 019 * <hr> 020 * Example to create an instance using the builder pattern 021 * <div class=code-example> 022 * <pre><code class='java'> 023 * ShoppingListChangeTextLineItemQuantityAction shoppingListChangeTextLineItemQuantityAction = ShoppingListChangeTextLineItemQuantityAction.builder() 024 * .textLineItemId("{textLineItemId}") 025 * .quantity(0.3) 026 * .build() 027 * </code></pre> 028 * </div> 029 */ 030@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 031@JsonDeserialize(as = ShoppingListChangeTextLineItemQuantityActionImpl.class) 032public interface ShoppingListChangeTextLineItemQuantityAction extends ShoppingListUpdateAction { 033 034 /** 035 * discriminator value for ShoppingListChangeTextLineItemQuantityAction 036 */ 037 String CHANGE_TEXT_LINE_ITEM_QUANTITY = "changeTextLineItemQuantity"; 038 039 /** 040 * <p>The <code>id</code> of the TextLineItem to update.</p> 041 * @return textLineItemId 042 */ 043 @NotNull 044 @JsonProperty("textLineItemId") 045 public String getTextLineItemId(); 046 047 /** 048 * <p>New value to set. If <code>0</code>, the TextLineItem is removed from the ShoppingList.</p> 049 * @return quantity 050 */ 051 @NotNull 052 @JsonProperty("quantity") 053 public Long getQuantity(); 054 055 /** 056 * <p>The <code>id</code> of the TextLineItem to update.</p> 057 * @param textLineItemId value to be set 058 */ 059 060 public void setTextLineItemId(final String textLineItemId); 061 062 /** 063 * <p>New value to set. If <code>0</code>, the TextLineItem is removed from the ShoppingList.</p> 064 * @param quantity value to be set 065 */ 066 067 public void setQuantity(final Long quantity); 068 069 /** 070 * factory method 071 * @return instance of ShoppingListChangeTextLineItemQuantityAction 072 */ 073 public static ShoppingListChangeTextLineItemQuantityAction of() { 074 return new ShoppingListChangeTextLineItemQuantityActionImpl(); 075 } 076 077 /** 078 * factory method to create a shallow copy ShoppingListChangeTextLineItemQuantityAction 079 * @param template instance to be copied 080 * @return copy instance 081 */ 082 public static ShoppingListChangeTextLineItemQuantityAction of( 083 final ShoppingListChangeTextLineItemQuantityAction template) { 084 ShoppingListChangeTextLineItemQuantityActionImpl instance = new ShoppingListChangeTextLineItemQuantityActionImpl(); 085 instance.setTextLineItemId(template.getTextLineItemId()); 086 instance.setQuantity(template.getQuantity()); 087 return instance; 088 } 089 090 /** 091 * factory method to create a deep copy of ShoppingListChangeTextLineItemQuantityAction 092 * @param template instance to be copied 093 * @return copy instance 094 */ 095 @Nullable 096 public static ShoppingListChangeTextLineItemQuantityAction deepCopy( 097 @Nullable final ShoppingListChangeTextLineItemQuantityAction template) { 098 if (template == null) { 099 return null; 100 } 101 ShoppingListChangeTextLineItemQuantityActionImpl instance = new ShoppingListChangeTextLineItemQuantityActionImpl(); 102 instance.setTextLineItemId(template.getTextLineItemId()); 103 instance.setQuantity(template.getQuantity()); 104 return instance; 105 } 106 107 /** 108 * builder factory method for ShoppingListChangeTextLineItemQuantityAction 109 * @return builder 110 */ 111 public static ShoppingListChangeTextLineItemQuantityActionBuilder builder() { 112 return ShoppingListChangeTextLineItemQuantityActionBuilder.of(); 113 } 114 115 /** 116 * create builder for ShoppingListChangeTextLineItemQuantityAction instance 117 * @param template instance with prefilled values for the builder 118 * @return builder 119 */ 120 public static ShoppingListChangeTextLineItemQuantityActionBuilder builder( 121 final ShoppingListChangeTextLineItemQuantityAction template) { 122 return ShoppingListChangeTextLineItemQuantityActionBuilder.of(template); 123 } 124 125 /** 126 * accessor map function 127 * @param <T> mapped type 128 * @param helper function to map the object 129 * @return mapped value 130 */ 131 default <T> T withShoppingListChangeTextLineItemQuantityAction( 132 Function<ShoppingListChangeTextLineItemQuantityAction, T> helper) { 133 return helper.apply(this); 134 } 135 136 /** 137 * gives a TypeReference for usage with Jackson DataBind 138 * @return TypeReference 139 */ 140 public static com.fasterxml.jackson.core.type.TypeReference<ShoppingListChangeTextLineItemQuantityAction> typeReference() { 141 return new com.fasterxml.jackson.core.type.TypeReference<ShoppingListChangeTextLineItemQuantityAction>() { 142 @Override 143 public String toString() { 144 return "TypeReference<ShoppingListChangeTextLineItemQuantityAction>"; 145 } 146 }; 147 } 148}