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.GeneratedMessageV3.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.GeneratedMessageV3.Builder<Rating.Builder> implements RatingOrBuilder
The rating of a [Product][google.cloud.retail.v2alpha.Product].
Protobuf typegoogle.cloud.retail.v2alpha.Rating
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Rating.Builder
addAllRatingHistogram(Iterable<? extends Integer> values)
List of rating counts per rating value (index = rating - 1).Rating.Builder
addRatingHistogram(int value)
List of rating counts per rating value (index = rating - 1).Rating.Builder
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
Rating
build()
Rating
buildPartial()
Rating.Builder
clear()
Rating.Builder
clearAverageRating()
The average rating of the [Product][google.cloud.retail.v2alpha.Product].Rating.Builder
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
Rating.Builder
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
Rating.Builder
clearRatingCount()
The total number of ratings.Rating.Builder
clearRatingHistogram()
List of rating counts per rating value (index = rating - 1).Rating.Builder
clone()
float
getAverageRating()
The average rating of the [Product][google.cloud.retail.v2alpha.Product].Rating
getDefaultInstanceForType()
static com.google.protobuf.Descriptors.Descriptor
getDescriptor()
com.google.protobuf.Descriptors.Descriptor
getDescriptorForType()
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).protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()
boolean
isInitialized()
Rating.Builder
mergeFrom(Rating other)
Rating.Builder
mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Rating.Builder
mergeFrom(com.google.protobuf.Message other)
Rating.Builder
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
Rating.Builder
setAverageRating(float value)
The average rating of the [Product][google.cloud.retail.v2alpha.Product].Rating.Builder
setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
Rating.Builder
setRatingCount(int value)
The total number of ratings.Rating.Builder
setRatingHistogram(int index, int value)
List of rating counts per rating value (index = rating - 1).Rating.Builder
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
Rating.Builder
setUnknownFields(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:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
clear
public Rating.Builder clear()
- Specified by:
clear
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clear
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clear
in classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.Message.Builder
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.MessageOrBuilder
- Overrides:
getDescriptorForType
in classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
getDefaultInstanceForType
public Rating getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
build
public Rating build()
- Specified by:
build
in interfacecom.google.protobuf.Message.Builder
- Specified by:
build
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public Rating buildPartial()
- Specified by:
buildPartial
in interfacecom.google.protobuf.Message.Builder
- Specified by:
buildPartial
in interfacecom.google.protobuf.MessageLite.Builder
-
clone
public Rating.Builder clone()
- Specified by:
clone
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clone
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clone
in classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
setField
public Rating.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
setField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setField
in classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
clearField
public Rating.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
clearField
in classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
clearOneof
public Rating.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneof
in interfacecom.google.protobuf.Message.Builder
- Overrides:
clearOneof
in classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
setRepeatedField
public Rating.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
- Specified by:
setRepeatedField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setRepeatedField
in classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
addRepeatedField
public Rating.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
addRepeatedField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
addRepeatedField
in classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
mergeFrom
public Rating.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<Rating.Builder>
-
mergeFrom
public Rating.Builder mergeFrom(Rating other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in 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:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Specified by:
mergeFrom
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
mergeFrom
in 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:
getRatingCount
in 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.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
public Rating.Builder 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:
getAverageRating
in interfaceRatingOrBuilder
- Returns:
- The averageRating.
-
setAverageRating
public Rating.Builder setAverageRating(float value)
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
public Rating.Builder 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
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.v2alpha.Product] got 41 ratings with 1 star, 14 ratings with 2 star, and so on.
repeated int32 rating_histogram = 3;
- Specified by:
getRatingHistogramList
in 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:
getRatingHistogramCount
in 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:
getRatingHistogram
in 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.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
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.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
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.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
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.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.
-
setUnknownFields
public final Rating.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
setUnknownFields
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setUnknownFields
in classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
mergeUnknownFields
public final Rating.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFields
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeUnknownFields
in classcom.google.protobuf.GeneratedMessageV3.Builder<Rating.Builder>
-
-