Interface RelativeAllocationDraft
- All Superinterfaces:
AllocationDraft,Draft<RelativeAllocationDraft>
Allocates a percentage of the Order total to a Payment Method.
Example to create an instance using the builder pattern
RelativeAllocationDraft relativeAllocationDraft = RelativeAllocationDraft.builder()
.percentage(0.3)
.build()
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for RelativeAllocationDraftbuilder(RelativeAllocationDraft template) create builder for RelativeAllocationDraft instancecopyDeep()static RelativeAllocationDraftdeepCopy(RelativeAllocationDraft template) factory method to create a deep copy of RelativeAllocationDraft@NotNull IntegerPercentage of the Order total allocated to the Payment Method.static RelativeAllocationDraftof()factory methodstatic RelativeAllocationDraftof(RelativeAllocationDraft template) factory method to create a shallow copy RelativeAllocationDraftvoidsetPercentage(Integer percentage) Percentage of the Order total allocated to the Payment Method.static tools.jackson.core.type.TypeReference<RelativeAllocationDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map functionMethods inherited from interface com.commercetools.api.models.cart.AllocationDraft
getType, withAllocationDraft
-
Field Details
-
RELATIVE
discriminator value for RelativeAllocationDraft- 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 RelativeAllocationDraft
-
of
factory method to create a shallow copy RelativeAllocationDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
RelativeAllocationDraft copyDeep()- Specified by:
copyDeepin interfaceAllocationDraft
-
deepCopy
factory method to create a deep copy of RelativeAllocationDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for RelativeAllocationDraft- Returns:
- builder
-
builder
create builder for RelativeAllocationDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withRelativeAllocationDraft
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
-