Class ReturnItemBuilder
java.lang.Object
com.commercetools.history.models.common.ReturnItemBuilder
- All Implemented Interfaces:
Builder<ReturnItem>
ReturnItemBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
ReturnItem returnItem = ReturnItem.builder()
.id("{id}")
.quantity(1)
.type("{type}")
.comment("{comment}")
.shipmentState(ReturnShipmentState.ADVISED)
.paymentState(ReturnPaymentState.NON_REFUNDABLE)
.lastModifiedAt("{lastModifiedAt}")
.createdAt("{createdAt}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds ReturnItem with checking for non-null required valuesbuilds ReturnItem without checking for non-null required valuesset the value to the commentset the value to the createdAtvalue of comment}value of createdAt}getId()
value of id}value of lastModifiedAt}value of paymentState}value of quantity}value of shipmentState}getType()
value of type}set the value to the idlastModifiedAt
(String lastModifiedAt) set the value to the lastModifiedAtstatic ReturnItemBuilder
of()
factory method for an instance of ReturnItemBuilderstatic ReturnItemBuilder
of
(ReturnItem template) create builder for ReturnItem instancepaymentState
(ReturnPaymentState paymentState) set the value to the paymentStateset the value to the quantityshipmentState
(ReturnShipmentState shipmentState) set the value to the shipmentStateset the value to the type
-
Constructor Details
-
ReturnItemBuilder
public ReturnItemBuilder()
-
-
Method Details
-
id
set the value to the id- Parameters:
id
- value to be set- Returns:
- Builder
-
quantity
set the value to the quantity- Parameters:
quantity
- value to be set- Returns:
- Builder
-
type
set the value to the type- Parameters:
type
- value to be set- Returns:
- Builder
-
comment
set the value to the comment- Parameters:
comment
- value to be set- Returns:
- Builder
-
shipmentState
set the value to the shipmentState- Parameters:
shipmentState
- value to be set- Returns:
- Builder
-
paymentState
set the value to the paymentState- Parameters:
paymentState
- value to be set- Returns:
- Builder
-
lastModifiedAt
set the value to the lastModifiedAt- Parameters:
lastModifiedAt
- value to be set- Returns:
- Builder
-
createdAt
set the value to the createdAt- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
getId
value of id}- Returns:
- id
-
getQuantity
value of quantity}- Returns:
- quantity
-
getType
value of type}- Returns:
- type
-
getComment
value of comment}- Returns:
- comment
-
getShipmentState
value of shipmentState}- Returns:
- shipmentState
-
getPaymentState
value of paymentState}- Returns:
- paymentState
-
getLastModifiedAt
value of lastModifiedAt}- Returns:
- lastModifiedAt
-
getCreatedAt
value of createdAt}- Returns:
- createdAt
-
build
builds ReturnItem with checking for non-null required values- Specified by:
build
in interfaceBuilder<ReturnItem>
- Returns:
- ReturnItem
-
buildUnchecked
builds ReturnItem without checking for non-null required values- Returns:
- ReturnItem
-
of
factory method for an instance of ReturnItemBuilder- Returns:
- builder
-
of
create builder for ReturnItem instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-