Package com.google.cloud.retail.v2beta
Interface RatingOrBuilder
-
- All Superinterfaces:
com.google.protobuf.MessageLiteOrBuilder
,com.google.protobuf.MessageOrBuilder
- All Known Implementing Classes:
Rating
,Rating.Builder
public interface RatingOrBuilder extends com.google.protobuf.MessageOrBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description float
getAverageRating()
The average rating of the [Product][google.cloud.retail.v2beta.Product].int
getRatingCount()
The total number of ratings.int
getRatingHistogram(int index)
List of rating counts per rating value (index = rating - 1).int
getRatingHistogramCount()
List of rating counts per rating value (index = rating - 1).List<Integer>
getRatingHistogramList()
List of rating counts per rating value (index = rating - 1).-
Methods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
-
-
-
Method Detail
-
getRatingCount
int getRatingCount()
The total number of ratings. This value is independent of the value of [rating_histogram][google.cloud.retail.v2beta.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.v2beta.Product]. The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is returned.
float average_rating = 2;
- Returns:
- The averageRating.
-
getRatingHistogramList
List<Integer> 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.v2beta.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.v2beta.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.v2beta.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.
-
-