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 instancestatic ReviewRatingStatistics
deepCopy
(ReviewRatingStatistics template) factory method to create a deep copy of ReviewRatingStatistics@NotNull Double
Average rating of one target This number is rounded with 5 decimals.@NotNull Integer
getCount()
Number of ratings taken into account@NotNull Double
Highest rating of one target@NotNull Double
Lowest rating of one target@NotNull @Valid Object
Full distribution of the ratings.static ReviewRatingStatistics
of()
factory methodstatic ReviewRatingStatistics
of
(ReviewRatingStatistics template) factory method to create a shallow copy ReviewRatingStatisticsvoid
setAverageRating
(Double averageRating) Average rating of one target This number is rounded with 5 decimals.void
Number of ratings taken into accountvoid
setHighestRating
(Double highestRating) Highest rating of one targetvoid
setLowestRating
(Double lowestRating) Lowest rating of one targetvoid
setRatingsDistribution
(Object ratingsDistribution) Full distribution of the ratings.static com.fasterxml.jackson.core.type.TypeReference<ReviewRatingStatistics>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor 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
-
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
-