Class ReviewDraftBuilder
- All Implemented Interfaces:
Builder<ReviewDraft>
Example to create an instance using the builder pattern
ReviewDraft reviewDraft = ReviewDraft.builder()
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionauthorName
(String authorName) Name of the author.build()
builds ReviewDraft with checking for non-null required valuesbuilds ReviewDraft without checking for non-null required valuescustom
(CustomFieldsDraft custom) Custom Fields for the Review.Custom Fields for the Review.customer
(CustomerResourceIdentifier customer) Customer who created the Review.Customer who created the Review.Name of the author.Custom Fields for the Review.Customer who created the Review.getKey()
User-defined unique identifier for the Review.Language in which the content of the Review is written.Rating of the targeted Product or Channel.getState()
State of the Review.Draft type to create a Reference or a KeyReference to a resource.getText()
Content of the Review.getTitle()
Title of the Review.If set, this value must be unique among Reviews.User-defined unique identifier for the Review.Language in which the content of the Review is written.static ReviewDraftBuilder
of()
factory method for an instance of ReviewDraftBuilderstatic ReviewDraftBuilder
of
(ReviewDraft template) create builder for ReviewDraft instanceRating of the targeted Product or Channel.state
(StateResourceIdentifier state) State of the Review.State of the Review.target
(ResourceIdentifier target) Draft type to create a Reference or a KeyReference to a resource.target
(Function<ResourceIdentifierBuilder, Builder<? extends ResourceIdentifier>> builder) Draft type to create a Reference or a KeyReference to a resource.Content of the Review.Title of the Review.uniquenessValue
(String uniquenessValue) If set, this value must be unique among Reviews.Custom Fields for the Review.Customer who created the Review.State of the Review.
-
Constructor Details
-
ReviewDraftBuilder
public ReviewDraftBuilder()
-
-
Method Details
-
key
User-defined unique identifier for the Review.
- Parameters:
key
- value to be set- Returns:
- Builder
-
uniquenessValue
If set, this value must be unique among Reviews. For example, if you want to have only one Review per Customer and per Product, you can set the value to Customer
id
+ Productid
.- Parameters:
uniquenessValue
- value to be set- Returns:
- Builder
-
locale
Language in which the content of the Review is written.
- Parameters:
locale
- value to be set- Returns:
- Builder
-
authorName
Name of the author.
- Parameters:
authorName
- value to be set- Returns:
- Builder
-
title
Title of the Review.
- Parameters:
title
- value to be set- Returns:
- Builder
-
text
Content of the Review.
- Parameters:
text
- value to be set- Returns:
- Builder
-
target
Draft type to create a Reference or a KeyReference to a resource. Provide either the
id
or (wherever supported) thekey
of the resource to reference, but depending on the API endpoint the response returns either a Reference or a KeyReference. For example, the fieldparent
of a CategoryDraft takes a ResourceIdentifier for its value while the value of the corresponding field of a Category is a Reference.Each resource type has its corresponding ResourceIdentifier, like ChannelResourceIdentifier.
- Parameters:
target
- value to be set- Returns:
- Builder
-
target
public ReviewDraftBuilder target(Function<ResourceIdentifierBuilder, Builder<? extends ResourceIdentifier>> builder) Draft type to create a Reference or a KeyReference to a resource. Provide either the
id
or (wherever supported) thekey
of the resource to reference, but depending on the API endpoint the response returns either a Reference or a KeyReference. For example, the fieldparent
of a CategoryDraft takes a ResourceIdentifier for its value while the value of the corresponding field of a Category is a Reference.Each resource type has its corresponding ResourceIdentifier, like ChannelResourceIdentifier.
- Parameters:
builder
- function to build the target value- Returns:
- Builder
-
state
public ReviewDraftBuilder state(Function<StateResourceIdentifierBuilder, StateResourceIdentifierBuilder> builder) State of the Review. Used for approval processes, see Review approval process for details.
- Parameters:
builder
- function to build the state value- Returns:
- Builder
-
withState
public ReviewDraftBuilder withState(Function<StateResourceIdentifierBuilder, StateResourceIdentifier> builder) State of the Review. Used for approval processes, see Review approval process for details.
- Parameters:
builder
- function to build the state value- Returns:
- Builder
-
state
State of the Review. Used for approval processes, see Review approval process for details.
- Parameters:
state
- value to be set- Returns:
- Builder
-
rating
Rating of the targeted Product or Channel. This rating can represent the number of stars, a percentage, or a like (+1)/dislike (-1). A rating is used in the ratings statistics of the targeted object, unless the Review is in a State that does not have the role
ReviewIncludedInStatistics
.- Parameters:
rating
- value to be set- Returns:
- Builder
-
customer
public ReviewDraftBuilder customer(Function<CustomerResourceIdentifierBuilder, CustomerResourceIdentifierBuilder> builder) Customer who created the Review.
- Parameters:
builder
- function to build the customer value- Returns:
- Builder
-
withCustomer
public ReviewDraftBuilder withCustomer(Function<CustomerResourceIdentifierBuilder, CustomerResourceIdentifier> builder) Customer who created the Review.
- Parameters:
builder
- function to build the customer value- Returns:
- Builder
-
customer
Customer who created the Review.
- Parameters:
customer
- value to be set- Returns:
- Builder
-
custom
public ReviewDraftBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields for the Review.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields for the Review.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields for the Review.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getKey
User-defined unique identifier for the Review.
- Returns:
- key
-
getUniquenessValue
If set, this value must be unique among Reviews. For example, if you want to have only one Review per Customer and per Product, you can set the value to Customer
id
+ Productid
.- Returns:
- uniquenessValue
-
getLocale
Language in which the content of the Review is written.
- Returns:
- locale
-
getAuthorName
Name of the author.
- Returns:
- authorName
-
getTitle
Title of the Review.
- Returns:
- title
-
getText
Content of the Review.
- Returns:
- text
-
getTarget
Draft type to create a Reference or a KeyReference to a resource. Provide either the
id
or (wherever supported) thekey
of the resource to reference, but depending on the API endpoint the response returns either a Reference or a KeyReference. For example, the fieldparent
of a CategoryDraft takes a ResourceIdentifier for its value while the value of the corresponding field of a Category is a Reference.Each resource type has its corresponding ResourceIdentifier, like ChannelResourceIdentifier.
- Returns:
- target
-
getState
State of the Review. Used for approval processes, see Review approval process for details.
- Returns:
- state
-
getRating
Rating of the targeted Product or Channel. This rating can represent the number of stars, a percentage, or a like (+1)/dislike (-1). A rating is used in the ratings statistics of the targeted object, unless the Review is in a State that does not have the role
ReviewIncludedInStatistics
.- Returns:
- rating
-
getCustomer
Customer who created the Review.
- Returns:
- customer
-
getCustom
Custom Fields for the Review.
- Returns:
- custom
-
build
builds ReviewDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<ReviewDraft>
- Returns:
- ReviewDraft
-
buildUnchecked
builds ReviewDraft without checking for non-null required values- Returns:
- ReviewDraft
-
of
factory method for an instance of ReviewDraftBuilder- Returns:
- builder
-
of
create builder for ReviewDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-