Class AssetBuilder
java.lang.Object
com.commercetools.history.models.common.AssetBuilder
AssetBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
Asset asset = Asset.builder()
.id("{id}")
.name(nameBuilder -> nameBuilder)
.description(descriptionBuilder -> descriptionBuilder)
.custom(customBuilder -> customBuilder)
.key("{key}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds Asset with checking for non-null required valuesbuilds Asset without checking for non-null required valuescustom
(CustomFields custom) set the value to the customcustom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) set the value to the custom using the builder functiondescription
(LocalizedString description) set the value to the descriptionset the value to the description using the builder functionvalue of custom}value of description}getId()
value of id}getKey()
value of key}getName()
value of name}set the value to the idset the value to the keyname
(LocalizedString name) set the value to the nameset the value to the name using the builder functionstatic AssetBuilder
of()
factory method for an instance of AssetBuilderstatic AssetBuilder
create builder for Asset instancewithCustom
(Function<CustomFieldsBuilder, CustomFields> builder) set the value to the custom using the builder functionset the value to the description using the builder functionset the value to the name using the builder function
-
Constructor Details
-
AssetBuilder
public AssetBuilder()
-
-
Method Details
-
id
set the value to the id- Parameters:
id
- value to be set- Returns:
- Builder
-
name
set the value to the name using the builder function- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
withName
set the value to the name using the builder function- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
name
set the value to the name- Parameters:
name
- value to be set- Returns:
- Builder
-
description
set the value to the description using the builder function- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
withDescription
set the value to the description using the builder function- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
description
set the value to the description- Parameters:
description
- value to be set- Returns:
- Builder
-
custom
set the value to the custom using the builder function- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
set the value to the custom using the builder function- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
set the value to the custom- Parameters:
custom
- 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
-
getName
value of name}- Returns:
- name
-
getDescription
value of description}- Returns:
- description
-
getCustom
value of custom}- Returns:
- custom
-
getKey
value of key}- Returns:
- key
-
build
builds Asset with checking for non-null required values -
buildUnchecked
builds Asset without checking for non-null required values- Returns:
- Asset
-
of
factory method for an instance of AssetBuilder- Returns:
- builder
-
of
create builder for Asset instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-