Package com.google.cloud.retail.v2alpha
Class Rating.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Rating.Builder>
com.google.cloud.retail.v2alpha.Rating.Builder
- All Implemented Interfaces:
RatingOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- Rating
public static final class Rating.Builder
extends com.google.protobuf.GeneratedMessage.Builder<Rating.Builder>
implements RatingOrBuilder
The rating of a [Product][google.cloud.retail.v2alpha.Product].Protobuf type
google.cloud.retail.v2alpha.Rating-
Method Summary
Modifier and TypeMethodDescriptionaddAllRatingHistogram(Iterable<? extends Integer> values) List of rating counts per rating value (index = rating - 1).addRatingHistogram(int value) List of rating counts per rating value (index = rating - 1).build()clear()The average rating of the [Product][google.cloud.retail.v2alpha.Product].The total number of ratings.List of rating counts per rating value (index = rating - 1).floatThe average rating of the [Product][google.cloud.retail.v2alpha.Product].static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorintThe 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).protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) setAverageRating(float value) The average rating of the [Product][google.cloud.retail.v2alpha.Product].setRatingCount(int value) The total number of ratings.setRatingHistogram(int index, int value) List of rating counts per rating value (index = rating - 1).Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<Rating.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<Rating.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<Rating.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Rating.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<Rating.Builder>
-
mergeFrom
public Rating.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Rating.Builder>- Throws:
IOException
-
getRatingCount
public 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;- Specified by:
getRatingCountin interfaceRatingOrBuilder- Returns:
- The ratingCount.
-
setRatingCount
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;- Parameters:
value- The ratingCount to set.- Returns:
- This builder for chaining.
-
clearRatingCount
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:
- This builder for chaining.
-
getAverageRating
public 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;- Specified by:
getAverageRatingin interfaceRatingOrBuilder- Returns:
- The averageRating.
-
setAverageRating
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;- Parameters:
value- The averageRating to set.- Returns:
- This builder for chaining.
-
clearAverageRating
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:
- This builder for chaining.
-
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;- Specified by:
getRatingHistogramListin interfaceRatingOrBuilder- Returns:
- A list containing the ratingHistogram.
-
getRatingHistogramCount
public 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;- Specified by:
getRatingHistogramCountin interfaceRatingOrBuilder- Returns:
- The count of ratingHistogram.
-
getRatingHistogram
public 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;- Specified by:
getRatingHistogramin interfaceRatingOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The ratingHistogram at the given index.
-
setRatingHistogram
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 to set the value at.value- The ratingHistogram to set.- Returns:
- This builder for chaining.
-
addRatingHistogram
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:
value- The ratingHistogram to add.- Returns:
- This builder for chaining.
-
addAllRatingHistogram
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:
values- The ratingHistogram to add.- Returns:
- This builder for chaining.
-
clearRatingHistogram
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:
- This builder for chaining.
-