Interface RelativeAllocation
- All Superinterfaces:
Allocation
Allocates a percentage of the Order total to a Payment Method.
Example to create an instance using the builder pattern
RelativeAllocation relativeAllocation = RelativeAllocation.builder()
.percentage(0.3)
.build()
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic RelativeAllocationBuilderbuilder()builder factory method for RelativeAllocationstatic RelativeAllocationBuilderbuilder(RelativeAllocation template) create builder for RelativeAllocation instancecopyDeep()static RelativeAllocationdeepCopy(RelativeAllocation template) factory method to create a deep copy of RelativeAllocation@NotNull IntegerPercentage of the Order total allocated to the Payment Method.static RelativeAllocationof()factory methodstatic RelativeAllocationof(RelativeAllocation template) factory method to create a shallow copy RelativeAllocationvoidsetPercentage(Integer percentage) Percentage of the Order total allocated to the Payment Method.static tools.jackson.core.type.TypeReference<RelativeAllocation>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithRelativeAllocation(Function<RelativeAllocation, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.cart.Allocation
getType, withAllocation
-
Field Details
-
RELATIVE
discriminator value for RelativeAllocation- See Also:
-
-
Method Details
-
getPercentage
Percentage of the Order total allocated to the Payment Method. For example,
100allocates the entire Order total.- Returns:
- percentage
-
setPercentage
Percentage of the Order total allocated to the Payment Method. For example,
100allocates the entire Order total.- Parameters:
percentage- value to be set
-
of
factory method- Returns:
- instance of RelativeAllocation
-
of
factory method to create a shallow copy RelativeAllocation- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
RelativeAllocation copyDeep()- Specified by:
copyDeepin interfaceAllocation
-
deepCopy
factory method to create a deep copy of RelativeAllocation- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for RelativeAllocation- Returns:
- builder
-
builder
create builder for RelativeAllocation instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withRelativeAllocation
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-