Interface ReviewRatingStatistics


public interface ReviewRatingStatistics
ReviewRatingStatistics
Example to create an instance using the builder pattern

     ReviewRatingStatistics reviewRatingStatistics = ReviewRatingStatistics.builder()
             .averageRating(0.3)
             .highestRating(0.3)
             .lowestRating(0.3)
             .count(1)
             .ratingsDistribution(ratingsDistributionBuilder -> ratingsDistributionBuilder)
             .build()
 
  • Method Details

    • getAverageRating

      @NotNull @NotNull Double getAverageRating()

      Average rating of one target This number is rounded with 5 decimals.

      Returns:
      averageRating
    • getHighestRating

      @NotNull @NotNull Double getHighestRating()

      Highest rating of one target

      Returns:
      highestRating
    • getLowestRating

      @NotNull @NotNull Double getLowestRating()

      Lowest rating of one target

      Returns:
      lowestRating
    • getCount

      @NotNull @NotNull Integer getCount()

      Number of ratings taken into account

      Returns:
      count
    • getRatingsDistribution

      @NotNull @Valid @NotNull @Valid Object getRatingsDistribution()

      Full distribution of the ratings. The keys are the different ratings and the values are the count of reviews having this rating. Only the used ratings appear in this object.

      Returns:
      ratingsDistribution
    • setAverageRating

      void setAverageRating(Double averageRating)

      Average rating of one target This number is rounded with 5 decimals.

      Parameters:
      averageRating - value to be set
    • setHighestRating

      void setHighestRating(Double highestRating)

      Highest rating of one target

      Parameters:
      highestRating - value to be set
    • setLowestRating

      void setLowestRating(Double lowestRating)

      Lowest rating of one target

      Parameters:
      lowestRating - value to be set
    • setCount

      void setCount(Integer count)

      Number of ratings taken into account

      Parameters:
      count - value to be set
    • setRatingsDistribution

      void setRatingsDistribution(Object ratingsDistribution)

      Full distribution of the ratings. The keys are the different ratings and the values are the count of reviews having this rating. Only the used ratings appear in this object.

      Parameters:
      ratingsDistribution - value to be set
    • of

      factory method
      Returns:
      instance of ReviewRatingStatistics
    • of

      factory method to create a shallow copy ReviewRatingStatistics
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of ReviewRatingStatistics
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for ReviewRatingStatistics
      Returns:
      builder
    • builder

      create builder for ReviewRatingStatistics instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withReviewRatingStatistics

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

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