Interface ReviewDraft
- All Superinterfaces:
CustomizableDraft<ReviewDraft>
,Draft<ReviewDraft>
,WithKey
When creating a new Review, at least one of title
, text
or rating
should be set.
Example to create an instance using the builder pattern
ReviewDraft reviewDraft = ReviewDraft.builder()
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ReviewDraftBuilder
builder()
builder factory method for ReviewDraftstatic ReviewDraftBuilder
builder
(ReviewDraft template) create builder for ReviewDraft instancestatic ReviewDraft
deepCopy
(ReviewDraft template) factory method to create a deep copy of ReviewDraftName of the author.@Valid CustomFieldsDraft
Custom Fields for the Review.@Valid CustomerResourceIdentifier
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.@Valid StateResourceIdentifier
getState()
State of the Review.@Valid ResourceIdentifier
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.static ReviewDraft
of()
factory methodstatic ReviewDraft
of
(ReviewDraft template) factory method to create a shallow copy ReviewDraftvoid
setAuthorName
(String authorName) Name of the author.void
setCustom
(CustomFieldsDraft custom) Custom Fields for the Review.void
setCustomer
(CustomerResourceIdentifier customer) Customer who created the Review.void
User-defined unique identifier for the Review.void
Language in which the content of the Review is written.void
Rating of the targeted Product or Channel.void
setState
(StateResourceIdentifier state) State of the Review.void
setTarget
(ResourceIdentifier target) Draft type to create a Reference or a KeyReference to a resource.default void
Deprecated.void
Content of the Review.void
Title of the Review.void
setUniquenessValue
(String uniquenessValue) If set, this value must be unique among Reviews.static com.fasterxml.jackson.core.type.TypeReference<ReviewDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withReviewDraft
(Function<ReviewDraft, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.CustomizableDraft
unwrapCustomizableDraft
-
Method Details
-
getKey
String getKey()User-defined unique identifier for the Review.
-
getUniquenessValue
String 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
String getLocale()Language in which the content of the Review is written.
- Returns:
- locale
-
getAuthorName
String getAuthorName()Name of the author.
- Returns:
- authorName
-
getTitle
String getTitle()Title of the Review.
- Returns:
- title
-
getText
String 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
Integer 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.
- Specified by:
getCustom
in interfaceCustomizableDraft<ReviewDraft>
- Returns:
- custom
-
setKey
User-defined unique identifier for the Review.
- Parameters:
key
- value to be set
-
setUniquenessValue
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
-
setLocale
Language in which the content of the Review is written.
- Parameters:
locale
- value to be set
-
setAuthorName
Name of the author.
- Parameters:
authorName
- value to be set
-
setTitle
Title of the Review.
- Parameters:
title
- value to be set
-
setText
Content of the Review.
- Parameters:
text
- value to be set
-
setTarget
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
-
setState
State of the Review. Used for approval processes, see Review approval process for details.
- Parameters:
state
- value to be set
-
setRating
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
-
setCustomer
Customer who created the Review.
- Parameters:
customer
- value to be set
-
setCustom
Custom Fields for the Review.
- Specified by:
setCustom
in interfaceCustomizableDraft<ReviewDraft>
- Parameters:
custom
- value to be set
-
of
factory method- Returns:
- instance of ReviewDraft
-
of
factory method to create a shallow copy ReviewDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of ReviewDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ReviewDraft- Returns:
- builder
-
builder
create builder for ReviewDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withReviewDraft
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
setTarget
Deprecated. -
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-