Class CustomFieldsBuilder
java.lang.Object
com.commercetools.history.models.common.CustomFieldsBuilder
- All Implemented Interfaces:
Builder<CustomFields>
CustomFieldsBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
CustomFields customFields = CustomFields.builder()
.type(typeBuilder -> typeBuilder)
.fields(fieldsBuilder -> fieldsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds CustomFields with checking for non-null required valuesbuilds CustomFields without checking for non-null required valuesA valid JSON object, based on FieldDefinition.A valid JSON object, based on FieldDefinition.getType()
value of type}static CustomFieldsBuilder
of()
factory method for an instance of CustomFieldsBuilderstatic CustomFieldsBuilder
of
(CustomFields template) create builder for CustomFields instanceset the value to the typetype
(Function<ReferenceBuilder, ReferenceBuilder> builder) set the value to the type using the builder functionwithType
(Function<ReferenceBuilder, Reference> builder) set the value to the type using the builder function
-
Constructor Details
-
CustomFieldsBuilder
public CustomFieldsBuilder()
-
-
Method Details
-
type
set the value to the type using the builder function- Parameters:
builder
- function to build the type value- Returns:
- Builder
-
withType
set the value to the type using the builder function- Parameters:
builder
- function to build the type value- Returns:
- Builder
-
type
set the value to the type- Parameters:
type
- value to be set- Returns:
- Builder
-
fields
A valid JSON object, based on FieldDefinition.
- Parameters:
fields
- value to be set- Returns:
- Builder
-
getType
value of type}- Returns:
- type
-
getFields
A valid JSON object, based on FieldDefinition.
- Returns:
- fields
-
build
builds CustomFields with checking for non-null required values- Specified by:
build
in interfaceBuilder<CustomFields>
- Returns:
- CustomFields
-
buildUnchecked
builds CustomFields without checking for non-null required values- Returns:
- CustomFields
-
of
factory method for an instance of CustomFieldsBuilder- Returns:
- builder
-
of
create builder for CustomFields instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-