Package com.google.cloud.retail.v2alpha
Interface RatingOrBuilder
- All Superinterfaces:
com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder
- All Known Implementing Classes:
Rating,Rating.Builder
@Generated
public interface RatingOrBuilder
extends com.google.protobuf.MessageOrBuilder
-
Method Summary
Modifier and TypeMethodDescriptionfloatThe average rating of the [Product][google.cloud.retail.v2alpha.Product].intThe total number of ratings.intgetRatingHistogram(int index) List of rating counts per rating value (index = rating - 1).intList of rating counts per rating value (index = rating - 1).List of rating counts per rating value (index = rating - 1).Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder
isInitializedMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getRatingCount
int getRatingCount()The total number of ratings. This value is independent of the value of [rating_histogram][google.cloud.retail.v2alpha.Rating.rating_histogram]. This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is returned.
int32 rating_count = 1;- Returns:
- The ratingCount.
-
getAverageRating
float getAverageRating()The average rating of the [Product][google.cloud.retail.v2alpha.Product]. The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is returned.
float average_rating = 2;- Returns:
- The averageRating.
-
getRatingHistogramList
List of rating counts per rating value (index = rating - 1). The list is empty if there is no rating. If the list is non-empty, its size is always 5. Otherwise, an INVALID_ARGUMENT error is returned. For example, [41, 14, 13, 47, 303]. It means that the [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star, 14 ratings with 2 star, and so on.
repeated int32 rating_histogram = 3;- Returns:
- A list containing the ratingHistogram.
-
getRatingHistogramCount
int getRatingHistogramCount()List of rating counts per rating value (index = rating - 1). The list is empty if there is no rating. If the list is non-empty, its size is always 5. Otherwise, an INVALID_ARGUMENT error is returned. For example, [41, 14, 13, 47, 303]. It means that the [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star, 14 ratings with 2 star, and so on.
repeated int32 rating_histogram = 3;- Returns:
- The count of ratingHistogram.
-
getRatingHistogram
int getRatingHistogram(int index) List of rating counts per rating value (index = rating - 1). The list is empty if there is no rating. If the list is non-empty, its size is always 5. Otherwise, an INVALID_ARGUMENT error is returned. For example, [41, 14, 13, 47, 303]. It means that the [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star, 14 ratings with 2 star, and so on.
repeated int32 rating_histogram = 3;- Parameters:
index- The index of the element to return.- Returns:
- The ratingHistogram at the given index.
-