Class ParcelMeasurementsBuilder
java.lang.Object
com.commercetools.history.models.common.ParcelMeasurementsBuilder
- All Implemented Interfaces:
Builder<ParcelMeasurements>
ParcelMeasurementsBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
ParcelMeasurements parcelMeasurements = ParcelMeasurements.builder()
.heightInMillimeter(1)
.lengthInMillimeter(1)
.widthInMillimeter(1)
.weightInGram(1)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds ParcelMeasurements with checking for non-null required valuesbuilds ParcelMeasurements without checking for non-null required valuesvalue of heightInMillimeter}value of lengthInMillimeter}value of weightInGram}value of widthInMillimeter}heightInMillimeter
(Integer heightInMillimeter) set the value to the heightInMillimeterlengthInMillimeter
(Integer lengthInMillimeter) set the value to the lengthInMillimeterstatic ParcelMeasurementsBuilder
of()
factory method for an instance of ParcelMeasurementsBuilderstatic ParcelMeasurementsBuilder
of
(ParcelMeasurements template) create builder for ParcelMeasurements instanceweightInGram
(Integer weightInGram) set the value to the weightInGramwidthInMillimeter
(Integer widthInMillimeter) set the value to the widthInMillimeter
-
Constructor Details
-
ParcelMeasurementsBuilder
public ParcelMeasurementsBuilder()
-
-
Method Details
-
heightInMillimeter
set the value to the heightInMillimeter- Parameters:
heightInMillimeter
- value to be set- Returns:
- Builder
-
lengthInMillimeter
set the value to the lengthInMillimeter- Parameters:
lengthInMillimeter
- value to be set- Returns:
- Builder
-
widthInMillimeter
set the value to the widthInMillimeter- Parameters:
widthInMillimeter
- value to be set- Returns:
- Builder
-
weightInGram
set the value to the weightInGram- Parameters:
weightInGram
- value to be set- Returns:
- Builder
-
getHeightInMillimeter
value of heightInMillimeter}- Returns:
- heightInMillimeter
-
getLengthInMillimeter
value of lengthInMillimeter}- Returns:
- lengthInMillimeter
-
getWidthInMillimeter
value of widthInMillimeter}- Returns:
- widthInMillimeter
-
getWeightInGram
value of weightInGram}- Returns:
- weightInGram
-
build
builds ParcelMeasurements with checking for non-null required values- Specified by:
build
in interfaceBuilder<ParcelMeasurements>
- Returns:
- ParcelMeasurements
-
buildUnchecked
builds ParcelMeasurements without checking for non-null required values- Returns:
- ParcelMeasurements
-
of
factory method for an instance of ParcelMeasurementsBuilder- Returns:
- builder
-
of
create builder for ParcelMeasurements instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-