Package com.google.cloud.retail.v2beta
Class Rating.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderT>
-
- com.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
- com.google.cloud.retail.v2beta.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.GeneratedMessageV3.Builder<Rating.Builder> implements RatingOrBuilder
The rating of a [Product][google.cloud.retail.v2beta.Product].
Protobuf typegoogle.cloud.retail.v2beta.Rating
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Rating.BuilderaddAllRatingHistogram(Iterable<? extends Integer> values)List of rating counts per rating value (index = rating - 1).Rating.BuilderaddRatingHistogram(int value)List of rating counts per rating value (index = rating - 1).Rating.BuilderaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)Ratingbuild()RatingbuildPartial()Rating.Builderclear()Rating.BuilderclearAverageRating()The average rating of the [Product][google.cloud.retail.v2beta.Product].Rating.BuilderclearField(com.google.protobuf.Descriptors.FieldDescriptor field)Rating.BuilderclearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)Rating.BuilderclearRatingCount()The total number of ratings.Rating.BuilderclearRatingHistogram()List of rating counts per rating value (index = rating - 1).Rating.Builderclone()floatgetAverageRating()The average rating of the [Product][google.cloud.retail.v2beta.Product].RatinggetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()intgetRatingCount()The total number of ratings.intgetRatingHistogram(int index)List of rating counts per rating value (index = rating - 1).intgetRatingHistogramCount()List of rating counts per rating value (index = rating - 1).List<Integer>getRatingHistogramList()List of rating counts per rating value (index = rating - 1).protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()Rating.BuildermergeFrom(Rating other)Rating.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)Rating.BuildermergeFrom(com.google.protobuf.Message other)Rating.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)Rating.BuildersetAverageRating(float value)The average rating of the [Product][google.cloud.retail.v2beta.Product].Rating.BuildersetField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)Rating.BuildersetRatingCount(int value)The total number of ratings.Rating.BuildersetRatingHistogram(int index, int value)List of rating counts per rating value (index = rating - 1).Rating.BuildersetRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)Rating.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3
-
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
clear
public Rating.Builder clear()
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.Builder<Rating.Builder>
-
getDefaultInstanceForType
public Rating getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public Rating build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public Rating buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
public Rating.Builder clone()
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
setField
public Rating.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
clearField
public Rating.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
clearOneof
public Rating.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
setRepeatedField
public Rating.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
- Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
addRepeatedField
public Rating.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
mergeFrom
public Rating.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Rating.Builder>
-
mergeFrom
public Rating.Builder mergeFrom(Rating other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.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.v2beta.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
public Rating.Builder setRatingCount(int value)
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;- Parameters:
value- The ratingCount to set.- Returns:
- This builder for chaining.
-
clearRatingCount
public Rating.Builder clearRatingCount()
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:
- This builder for chaining.
-
getAverageRating
public 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;- Specified by:
getAverageRatingin interfaceRatingOrBuilder- Returns:
- The averageRating.
-
setAverageRating
public Rating.Builder setAverageRating(float value)
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;- Parameters:
value- The averageRating to set.- Returns:
- This builder for chaining.
-
clearAverageRating
public Rating.Builder clearAverageRating()
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:
- This builder for chaining.
-
getRatingHistogramList
public 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;- 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.v2beta.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.v2beta.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
public Rating.Builder setRatingHistogram(int index, int value)
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 to set the value at.value- The ratingHistogram to set.- Returns:
- This builder for chaining.
-
addRatingHistogram
public Rating.Builder addRatingHistogram(int value)
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:
value- The ratingHistogram to add.- Returns:
- This builder for chaining.
-
addAllRatingHistogram
public Rating.Builder addAllRatingHistogram(Iterable<? extends Integer> values)
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:
values- The ratingHistogram to add.- Returns:
- This builder for chaining.
-
clearRatingHistogram
public Rating.Builder 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.v2beta.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.
-
setUnknownFields
public final Rating.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
mergeUnknownFields
public final Rating.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
-