All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.commercetools.history.models.common.ItemShippingTarget Maven / Gradle / Ivy

There is a newer version: 17.15.1
Show newest version

package com.commercetools.history.models.common;

import java.time.*;
import java.util.*;
import java.util.function.Function;

import javax.annotation.Nullable;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;

import io.vrap.rmf.base.client.utils.Generated;

/**
 * ItemShippingTarget
 *
 * 
* Example to create an instance using the builder pattern *
*

 *     ItemShippingTarget itemShippingTarget = ItemShippingTarget.builder()
 *             .addressKey("{addressKey}")
 *             .quantity(1)
 *             .build()
 * 
*
*/ @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") @JsonDeserialize(as = ItemShippingTargetImpl.class) public interface ItemShippingTarget { /** *

The key of the address in the cart's itemShippingAddresses

* @return addressKey */ @NotNull @JsonProperty("addressKey") public String getAddressKey(); /** *

The quantity of items that should go to the address with the specified addressKey. Only positive values are allowed. Using 0 as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails.

* @return quantity */ @NotNull @JsonProperty("quantity") public Integer getQuantity(); /** *

The key of the address in the cart's itemShippingAddresses

* @param addressKey value to be set */ public void setAddressKey(final String addressKey); /** *

The quantity of items that should go to the address with the specified addressKey. Only positive values are allowed. Using 0 as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails.

* @param quantity value to be set */ public void setQuantity(final Integer quantity); /** * factory method * @return instance of ItemShippingTarget */ public static ItemShippingTarget of() { return new ItemShippingTargetImpl(); } /** * factory method to create a shallow copy ItemShippingTarget * @param template instance to be copied * @return copy instance */ public static ItemShippingTarget of(final ItemShippingTarget template) { ItemShippingTargetImpl instance = new ItemShippingTargetImpl(); instance.setAddressKey(template.getAddressKey()); instance.setQuantity(template.getQuantity()); return instance; } /** * factory method to create a deep copy of ItemShippingTarget * @param template instance to be copied * @return copy instance */ @Nullable public static ItemShippingTarget deepCopy(@Nullable final ItemShippingTarget template) { if (template == null) { return null; } ItemShippingTargetImpl instance = new ItemShippingTargetImpl(); instance.setAddressKey(template.getAddressKey()); instance.setQuantity(template.getQuantity()); return instance; } /** * builder factory method for ItemShippingTarget * @return builder */ public static ItemShippingTargetBuilder builder() { return ItemShippingTargetBuilder.of(); } /** * create builder for ItemShippingTarget instance * @param template instance with prefilled values for the builder * @return builder */ public static ItemShippingTargetBuilder builder(final ItemShippingTarget template) { return ItemShippingTargetBuilder.of(template); } /** * accessor map function * @param mapped type * @param helper function to map the object * @return mapped value */ default T withItemShippingTarget(Function helper) { return helper.apply(this); } /** * gives a TypeReference for usage with Jackson DataBind * @return TypeReference */ public static com.fasterxml.jackson.core.type.TypeReference typeReference() { return new com.fasterxml.jackson.core.type.TypeReference() { @Override public String toString() { return "TypeReference"; } }; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy