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 * ShoppingListChangeLineItemQuantityAction
018 *
019 * <hr>
020 * Example to create an instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     ShoppingListChangeLineItemQuantityAction shoppingListChangeLineItemQuantityAction = ShoppingListChangeLineItemQuantityAction.builder()
024 *             .lineItemId("{lineItemId}")
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 = ShoppingListChangeLineItemQuantityActionImpl.class)
032public interface ShoppingListChangeLineItemQuantityAction extends ShoppingListUpdateAction {
033
034    /**
035     * discriminator value for ShoppingListChangeLineItemQuantityAction
036     */
037    String CHANGE_LINE_ITEM_QUANTITY = "changeLineItemQuantity";
038
039    /**
040     *  <p>The <code>id</code> of the ShoppingListLineItem to update.</p>
041     * @return lineItemId
042     */
043    @NotNull
044    @JsonProperty("lineItemId")
045    public String getLineItemId();
046
047    /**
048     *  <p>New value to set. If <code>0</code>, the ShoppingListLineItem 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 ShoppingListLineItem to update.</p>
057     * @param lineItemId value to be set
058     */
059
060    public void setLineItemId(final String lineItemId);
061
062    /**
063     *  <p>New value to set. If <code>0</code>, the ShoppingListLineItem 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 ShoppingListChangeLineItemQuantityAction
072     */
073    public static ShoppingListChangeLineItemQuantityAction of() {
074        return new ShoppingListChangeLineItemQuantityActionImpl();
075    }
076
077    /**
078     * factory method to create a shallow copy ShoppingListChangeLineItemQuantityAction
079     * @param template instance to be copied
080     * @return copy instance
081     */
082    public static ShoppingListChangeLineItemQuantityAction of(final ShoppingListChangeLineItemQuantityAction template) {
083        ShoppingListChangeLineItemQuantityActionImpl instance = new ShoppingListChangeLineItemQuantityActionImpl();
084        instance.setLineItemId(template.getLineItemId());
085        instance.setQuantity(template.getQuantity());
086        return instance;
087    }
088
089    /**
090     * factory method to create a deep copy of ShoppingListChangeLineItemQuantityAction
091     * @param template instance to be copied
092     * @return copy instance
093     */
094    @Nullable
095    public static ShoppingListChangeLineItemQuantityAction deepCopy(
096            @Nullable final ShoppingListChangeLineItemQuantityAction template) {
097        if (template == null) {
098            return null;
099        }
100        ShoppingListChangeLineItemQuantityActionImpl instance = new ShoppingListChangeLineItemQuantityActionImpl();
101        instance.setLineItemId(template.getLineItemId());
102        instance.setQuantity(template.getQuantity());
103        return instance;
104    }
105
106    /**
107     * builder factory method for ShoppingListChangeLineItemQuantityAction
108     * @return builder
109     */
110    public static ShoppingListChangeLineItemQuantityActionBuilder builder() {
111        return ShoppingListChangeLineItemQuantityActionBuilder.of();
112    }
113
114    /**
115     * create builder for ShoppingListChangeLineItemQuantityAction instance
116     * @param template instance with prefilled values for the builder
117     * @return builder
118     */
119    public static ShoppingListChangeLineItemQuantityActionBuilder builder(
120            final ShoppingListChangeLineItemQuantityAction template) {
121        return ShoppingListChangeLineItemQuantityActionBuilder.of(template);
122    }
123
124    /**
125     * accessor map function
126     * @param <T> mapped type
127     * @param helper function to map the object
128     * @return mapped value
129     */
130    default <T> T withShoppingListChangeLineItemQuantityAction(
131            Function<ShoppingListChangeLineItemQuantityAction, T> helper) {
132        return helper.apply(this);
133    }
134
135    /**
136     * gives a TypeReference for usage with Jackson DataBind
137     * @return TypeReference
138     */
139    public static com.fasterxml.jackson.core.type.TypeReference<ShoppingListChangeLineItemQuantityAction> typeReference() {
140        return new com.fasterxml.jackson.core.type.TypeReference<ShoppingListChangeLineItemQuantityAction>() {
141            @Override
142            public String toString() {
143                return "TypeReference<ShoppingListChangeLineItemQuantityAction>";
144            }
145        };
146    }
147}