Interface ReviewDraft

All Superinterfaces:
CustomizableDraft<ReviewDraft>, Draft<ReviewDraft>, WithKey

public interface ReviewDraft extends CustomizableDraft<ReviewDraft>, WithKey, Draft<ReviewDraft>

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 Details

    • getKey

      String getKey()

      User-defined unique identifier for the Review.

      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • 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 + Product id.

      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

      @Valid @Valid 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.

      Returns:
      target
    • getState

      @Valid @Valid StateResourceIdentifier 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

      @Valid @Valid CustomerResourceIdentifier getCustomer()

      Customer who created the Review.

      Returns:
      customer
    • getCustom

      @Valid @Valid CustomFieldsDraft getCustom()

      Custom Fields for the Review.

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

      void setKey(String key)

      User-defined unique identifier for the Review.

      Parameters:
      key - value to be set
    • setUniquenessValue

      void setUniquenessValue(String 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 + Product id.

      Parameters:
      uniquenessValue - value to be set
    • setLocale

      void setLocale(String locale)

      Language in which the content of the Review is written.

      Parameters:
      locale - value to be set
    • setAuthorName

      void setAuthorName(String authorName)

      Name of the author.

      Parameters:
      authorName - value to be set
    • setTitle

      void setTitle(String title)

      Title of the Review.

      Parameters:
      title - value to be set
    • setText

      void setText(String text)

      Content of the Review.

      Parameters:
      text - value to be set
    • setTarget

      void setTarget(ResourceIdentifier target)

      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.

      Parameters:
      target - value to be set
    • setState

      void setState(StateResourceIdentifier state)

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

      Parameters:
      state - value to be set
    • setRating

      void setRating(Integer 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
    • setCustomer

      void setCustomer(CustomerResourceIdentifier customer)

      Customer who created the Review.

      Parameters:
      customer - value to be set
    • setCustom

      void setCustom(CustomFieldsDraft custom)

      Custom Fields for the Review.

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

      static ReviewDraft of()
      factory method
      Returns:
      instance of ReviewDraft
    • of

      static ReviewDraft of(ReviewDraft template)
      factory method to create a shallow copy ReviewDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static ReviewDraft deepCopy(@Nullable ReviewDraft template)
      factory method to create a deep copy of ReviewDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ReviewDraftBuilder builder()
      builder factory method for ReviewDraft
      Returns:
      builder
    • builder

      static ReviewDraftBuilder builder(ReviewDraft template)
      create builder for ReviewDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withReviewDraft

      default <T> T withReviewDraft(Function<ReviewDraft,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • setTarget

      @Deprecated default void setTarget(Object target)
      Deprecated.
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ReviewDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference