com.commercetools.history.models.common.ItemShippingTarget Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commercetools-sdk-java-history Show documentation
Show all versions of commercetools-sdk-java-history Show documentation
The e-commerce SDK from commercetools Composable Commerce for Java
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";
}
};
}
}