Class VariantBuilder
java.lang.Object
com.commercetools.history.models.common.VariantBuilder
VariantBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
Variant variant = Variant.builder()
.id(1)
.sku("{sku}")
.key("{key}")
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()builds Variant with checking for non-null required valuesbuilds Variant without checking for non-null required valuesgetId()value of id}getKey()value of key}getSku()value of sku}set the value to the idset the value to the keystatic VariantBuilderof()factory method for an instance of VariantBuilderstatic VariantBuildercreate builder for Variant instanceset the value to the sku
-
Constructor Details
-
VariantBuilder
public VariantBuilder()
-
-
Method Details
-
id
set the value to the id- Parameters:
id- value to be set- Returns:
- Builder
-
sku
set the value to the sku- Parameters:
sku- value to be set- Returns:
- Builder
-
key
set the value to the key- Parameters:
key- value to be set- Returns:
- Builder
-
getId
value of id}- Returns:
- id
-
getSku
value of sku}- Returns:
- sku
-
getKey
value of key}- Returns:
- key
-
build
builds Variant with checking for non-null required values -
buildUnchecked
builds Variant without checking for non-null required values- Returns:
- Variant
-
of
factory method for an instance of VariantBuilder- Returns:
- builder
-
of
create builder for Variant instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-