Class TextLineItemBuilder
java.lang.Object
com.commercetools.history.models.common.TextLineItemBuilder
- All Implemented Interfaces:
Builder<TextLineItem>
TextLineItemBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
TextLineItem textLineItem = TextLineItem.builder()
.addedAt("{addedAt}")
.custom(customBuilder -> customBuilder)
.description(descriptionBuilder -> descriptionBuilder)
.id("{id}")
.name(nameBuilder -> nameBuilder)
.quantity(1)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionset the value to the addedAtbuild()
builds TextLineItem with checking for non-null required valuesbuilds TextLineItem 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 addedAt}value of custom}value of description}getId()
value of id}getName()
value of name}value of quantity}set the value to the idname
(LocalizedString name) set the value to the nameset the value to the name using the builder functionstatic TextLineItemBuilder
of()
factory method for an instance of TextLineItemBuilderstatic TextLineItemBuilder
of
(TextLineItem template) create builder for TextLineItem instanceset the value to the quantitywithCustom
(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
-
TextLineItemBuilder
public TextLineItemBuilder()
-
-
Method Details
-
addedAt
set the value to the addedAt- Parameters:
addedAt
- 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
-
description
public TextLineItemBuilder description(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) set the value to the description using the builder function- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
withDescription
public TextLineItemBuilder withDescription(Function<LocalizedStringBuilder, LocalizedString> builder) 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
-
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
-
quantity
set the value to the quantity- Parameters:
quantity
- value to be set- Returns:
- Builder
-
getAddedAt
value of addedAt}- Returns:
- addedAt
-
getCustom
value of custom}- Returns:
- custom
-
getDescription
value of description}- Returns:
- description
-
getId
value of id}- Returns:
- id
-
getName
value of name}- Returns:
- name
-
getQuantity
value of quantity}- Returns:
- quantity
-
build
builds TextLineItem with checking for non-null required values- Specified by:
build
in interfaceBuilder<TextLineItem>
- Returns:
- TextLineItem
-
buildUnchecked
builds TextLineItem without checking for non-null required values- Returns:
- TextLineItem
-
of
factory method for an instance of TextLineItemBuilder- Returns:
- builder
-
of
create builder for TextLineItem instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-