Class ReviewDraftImpl

java.lang.Object
com.commercetools.api.models.review.ReviewDraftImpl
All Implemented Interfaces:
CustomizableDraft<ReviewDraft>, ReviewDraft, WithKey, io.vrap.rmf.base.client.Draft<ReviewDraft>, io.vrap.rmf.base.client.ModelBase

public class ReviewDraftImpl extends Object implements ReviewDraft, io.vrap.rmf.base.client.ModelBase

When creating a new Review, at least one of title, text or rating should be set.

  • Constructor Details

    • ReviewDraftImpl

      public ReviewDraftImpl()
      create empty instance
  • Method Details

    • getKey

      public String getKey()

      User-defined unique identifier for the Review.

      Specified by:
      getKey in interface ReviewDraft
      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getUniquenessValue

      public 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 + Product id.

      Specified by:
      getUniquenessValue in interface ReviewDraft
      Returns:
      uniquenessValue
    • getLocale

      public String getLocale()

      Language in which the content of the Review is written.

      Specified by:
      getLocale in interface ReviewDraft
      Returns:
      locale
    • getAuthorName

      public String getAuthorName()

      Name of the author.

      Specified by:
      getAuthorName in interface ReviewDraft
      Returns:
      authorName
    • getTitle

      public String getTitle()

      Title of the Review.

      Specified by:
      getTitle in interface ReviewDraft
      Returns:
      title
    • getText

      public String getText()

      Content of the Review.

      Specified by:
      getText in interface ReviewDraft
      Returns:
      text
    • getTarget

      public ResourceIdentifier getTarget()

      Draft type to create a Reference or a KeyReference to a resource. Provide either the id or (wherever supported) the key of the resource to reference, but depending on the API endpoint the response returns either a Reference or a KeyReference. For example, the field parent 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.

      Specified by:
      getTarget in interface ReviewDraft
      Returns:
      target
    • getState

      public StateResourceIdentifier getState()

      State of the Review. Used for approval processes, see Review approval process for details.

      Specified by:
      getState in interface ReviewDraft
      Returns:
      state
    • getRating

      public 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.

      Specified by:
      getRating in interface ReviewDraft
      Returns:
      rating
    • getCustomer

      public CustomerResourceIdentifier getCustomer()

      Customer who created the Review.

      Specified by:
      getCustomer in interface ReviewDraft
      Returns:
      customer
    • getCustom

      public CustomFieldsDraft getCustom()

      Custom Fields for the Review.

      Specified by:
      getCustom in interface CustomizableDraft<ReviewDraft>
      Specified by:
      getCustom in interface ReviewDraft
      Returns:
      custom
    • setKey

      public void setKey(String key)
      Description copied from interface: ReviewDraft

      User-defined unique identifier for the Review.

      Specified by:
      setKey in interface ReviewDraft
      Parameters:
      key - value to be set
    • setUniquenessValue

      public void setUniquenessValue(String uniquenessValue)
      Description copied from interface: ReviewDraft

      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 + Product id.

      Specified by:
      setUniquenessValue in interface ReviewDraft
      Parameters:
      uniquenessValue - value to be set
    • setLocale

      public void setLocale(String locale)
      Description copied from interface: ReviewDraft

      Language in which the content of the Review is written.

      Specified by:
      setLocale in interface ReviewDraft
      Parameters:
      locale - value to be set
    • setAuthorName

      public void setAuthorName(String authorName)
      Description copied from interface: ReviewDraft

      Name of the author.

      Specified by:
      setAuthorName in interface ReviewDraft
      Parameters:
      authorName - value to be set
    • setTitle

      public void setTitle(String title)
      Description copied from interface: ReviewDraft

      Title of the Review.

      Specified by:
      setTitle in interface ReviewDraft
      Parameters:
      title - value to be set
    • setText

      public void setText(String text)
      Description copied from interface: ReviewDraft

      Content of the Review.

      Specified by:
      setText in interface ReviewDraft
      Parameters:
      text - value to be set
    • setTarget

      public void setTarget(ResourceIdentifier target)
      Description copied from interface: ReviewDraft

      Draft type to create a Reference or a KeyReference to a resource. Provide either the id or (wherever supported) the key of the resource to reference, but depending on the API endpoint the response returns either a Reference or a KeyReference. For example, the field parent 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.

      Specified by:
      setTarget in interface ReviewDraft
      Parameters:
      target - value to be set
    • setState

      public void setState(StateResourceIdentifier state)
      Description copied from interface: ReviewDraft

      State of the Review. Used for approval processes, see Review approval process for details.

      Specified by:
      setState in interface ReviewDraft
      Parameters:
      state - value to be set
    • setRating

      public void setRating(Integer rating)
      Description copied from interface: ReviewDraft

      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.

      Specified by:
      setRating in interface ReviewDraft
      Parameters:
      rating - value to be set
    • setCustomer

      public void setCustomer(CustomerResourceIdentifier customer)
      Description copied from interface: ReviewDraft

      Customer who created the Review.

      Specified by:
      setCustomer in interface ReviewDraft
      Parameters:
      customer - value to be set
    • setCustom

      public void setCustom(CustomFieldsDraft custom)
      Description copied from interface: ReviewDraft

      Custom Fields for the Review.

      Specified by:
      setCustom in interface CustomizableDraft<ReviewDraft>
      Specified by:
      setCustom in interface ReviewDraft
      Parameters:
      custom - value to be set
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object