Class ReviewBuilder

java.lang.Object
com.commercetools.api.models.review.ReviewBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<Review>

public class ReviewBuilder extends Object implements io.vrap.rmf.base.client.Builder<Review>
ReviewBuilder
Example to create an instance using the builder pattern

     Review review = Review.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .includedInStatistics(true)
             .build()
 
  • Constructor Details

  • Method Details

    • id

      public ReviewBuilder id(String id)

      Unique identifier of the Review.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • version

      public ReviewBuilder version(Long version)

      Current version of the Review.

      Parameters:
      version - value to be set
      Returns:
      Builder
    • createdAt

      Date and time (UTC) the Review was initially created.

      Parameters:
      createdAt - value to be set
      Returns:
      Builder
    • lastModifiedAt

      public ReviewBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the Review was last updated.

      Parameters:
      lastModifiedAt - value to be set
      Returns:
      Builder
    • lastModifiedBy

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      builder - function to build the lastModifiedBy value
      Returns:
      Builder
    • withLastModifiedBy

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      builder - function to build the lastModifiedBy value
      Returns:
      Builder
    • lastModifiedBy

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      lastModifiedBy - value to be set
      Returns:
      Builder
    • createdBy

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      builder - function to build the createdBy value
      Returns:
      Builder
    • withCreatedBy

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      builder - function to build the createdBy value
      Returns:
      Builder
    • createdBy

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      createdBy - value to be set
      Returns:
      Builder
    • key

      User-defined unique identifier of the Review.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • uniquenessValue

      public ReviewBuilder uniquenessValue(@Nullable String uniquenessValue)

      Must be unique among Reviews. For example, if this value is set to Customer id + Product id, only one Review per Customer and per Product is allowed.

      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

      A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

      Parameters:
      target - value to be set
      Returns:
      Builder
    • target

      public ReviewBuilder target(Function<ReferenceBuilder,io.vrap.rmf.base.client.Builder<? extends Reference>> builder)

      A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

      Parameters:
      builder - function to build the target value
      Returns:
      Builder
    • includedInStatistics

      public ReviewBuilder includedInStatistics(Boolean includedInStatistics)

      Indicates if this Review is taken into account in the ratings statistics of the target. A Review is per default used in the statistics, unless the Review is in a state that does not have the role ReviewIncludedInStatistics. If the role of a State is modified after the calculation of this field, the calculation is not updated.

      Parameters:
      includedInStatistics - value to be set
      Returns:
      Builder
    • rating

      Rating of the Product or Channel.

      Parameters:
      rating - value to be set
      Returns:
      Builder
    • state

      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

      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
    • customer

      Customer who created the Review.

      Parameters:
      builder - function to build the customer value
      Returns:
      Builder
    • withCustomer

      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

      Custom Fields of the Review.

      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • withCustom

      Custom Fields of the Review.

      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • custom

      Custom Fields of the Review.

      Parameters:
      custom - value to be set
      Returns:
      Builder
    • getId

      public String getId()

      Unique identifier of the Review.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the Review.

      Returns:
      version
    • getCreatedAt

      Date and time (UTC) the Review was initially created.

      Returns:
      createdAt
    • getLastModifiedAt

      Date and time (UTC) the Review was last updated.

      Returns:
      lastModifiedAt
    • getLastModifiedBy

      Present on resources created after 1 February 2019 except for events not tracked.

      Returns:
      lastModifiedBy
    • getCreatedBy

      Present on resources created after 1 February 2019 except for events not tracked.

      Returns:
      createdBy
    • getKey

      User-defined unique identifier of the Review.

      Returns:
      key
    • getUniquenessValue

      Must be unique among Reviews. For example, if this value is set to Customer id + Product id, only one Review per Customer and per Product is allowed.

      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

      A Reference represents a loose reference to another resource in the same Project identified by its id. The typeId indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like ChannelReference. A referenced resource can be embedded through Reference Expansion. The expanded reference is the value of an additional obj field then.

      Returns:
      target
    • getIncludedInStatistics

      Indicates if this Review is taken into account in the ratings statistics of the target. A Review is per default used in the statistics, unless the Review is in a state that does not have the role ReviewIncludedInStatistics. If the role of a State is modified after the calculation of this field, the calculation is not updated.

      Returns:
      includedInStatistics
    • getRating

      Rating of the Product or Channel.

      Returns:
      rating
    • getState

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

      Returns:
      state
    • getCustomer

      Customer who created the Review.

      Returns:
      customer
    • getCustom

      Custom Fields of the Review.

      Returns:
      custom
    • build

      public Review build()
      builds Review with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<Review>
      Returns:
      Review
    • buildUnchecked

      builds Review without checking for non-null required values
      Returns:
      Review
    • of

      public static ReviewBuilder of()
      factory method for an instance of ReviewBuilder
      Returns:
      builder
    • of

      public static ReviewBuilder of(Review template)
      create builder for Review instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder