Interface ReviewRatingStatistics
public interface ReviewRatingStatistics
ReviewRatingStatistics
Example to create an instance using the builder pattern
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 Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for ReviewRatingStatisticsbuilder(ReviewRatingStatistics template) create builder for ReviewRatingStatistics instancecopyDeep()static ReviewRatingStatisticsdeepCopy(ReviewRatingStatistics template) factory method to create a deep copy of ReviewRatingStatistics@NotNull DoubleAverage rating of one target This number is rounded with 5 decimals.@NotNull IntegergetCount()Number of ratings taken into account@NotNull DoubleHighest rating of one target@NotNull DoubleLowest rating of one target@NotNull @Valid ObjectFull distribution of the ratings.static ReviewRatingStatisticsof()factory methodstatic ReviewRatingStatisticsof(ReviewRatingStatistics template) factory method to create a shallow copy ReviewRatingStatisticsvoidsetAverageRating(Double averageRating) Average rating of one target This number is rounded with 5 decimals.voidNumber of ratings taken into accountvoidsetHighestRating(Double highestRating) Highest rating of one targetvoidsetLowestRating(Double lowestRating) Lowest rating of one targetvoidsetRatingsDistribution(Object ratingsDistribution) Full distribution of the ratings.static com.fasterxml.jackson.core.type.TypeReference<ReviewRatingStatistics>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map function
-
Method Details
-
getAverageRating
Average rating of one target This number is rounded with 5 decimals.
- Returns:
- averageRating
-
getHighestRating
Highest rating of one target
- Returns:
- highestRating
-
getLowestRating
Lowest rating of one target
- Returns:
- lowestRating
-
getCount
Number of ratings taken into account
- Returns:
- count
-
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
Average rating of one target This number is rounded with 5 decimals.
- Parameters:
averageRating- value to be set
-
setHighestRating
Highest rating of one target
- Parameters:
highestRating- value to be set
-
setLowestRating
Lowest rating of one target
- Parameters:
lowestRating- value to be set
-
setCount
Number of ratings taken into account
- Parameters:
count- value to be set
-
setRatingsDistribution
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
-
copyDeep
ReviewRatingStatistics copyDeep() -
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
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-