Class Rating

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.retail.v2alpha.Rating
All Implemented Interfaces:
RatingOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

@Generated public final class Rating extends com.google.protobuf.GeneratedMessage implements RatingOrBuilder
 The rating of a [Product][google.cloud.retail.v2alpha.Product].
 
Protobuf type google.cloud.retail.v2alpha.Rating
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    The rating of a [Product][google.cloud.retail.v2alpha.Product].

    Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage

    com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message,T extends Object>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter

    Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessage

    com.google.protobuf.AbstractMessage.BuilderParent

    Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

    com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     

    Fields inherited from class com.google.protobuf.GeneratedMessage

    alwaysUseFieldBuilders, loggedPre22TypeNames, unknownFields

    Fields inherited from class com.google.protobuf.AbstractMessage

    memoizedSize

    Fields inherited from class com.google.protobuf.AbstractMessageLite

    memoizedHashCode
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    float
    The average rating of the [Product][google.cloud.retail.v2alpha.Product].
    static Rating
     
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    com.google.protobuf.Parser<Rating>
     
    int
    The total number of ratings.
    int
    getRatingHistogram(int index)
    List of rating counts per rating value (index = rating - 1).
    int
    List of rating counts per rating value (index = rating - 1).
    List of rating counts per rating value (index = rating - 1).
    int
     
    int
     
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
     
    final boolean
     
     
    newBuilder(Rating prototype)
     
     
    protected Rating.Builder
    newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
     
    static Rating
     
    static Rating
    parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Rating
    parseFrom(byte[] data)
     
    static Rating
    parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Rating
    parseFrom(com.google.protobuf.ByteString data)
     
    static Rating
    parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Rating
    parseFrom(com.google.protobuf.CodedInputStream input)
     
    static Rating
    parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Rating
     
    static Rating
    parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Rating
     
    static Rating
    parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static com.google.protobuf.Parser<Rating>
     
     
    void
    writeTo(com.google.protobuf.CodedOutputStream output)
     

    Methods inherited from class com.google.protobuf.GeneratedMessage

    canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag

    Methods inherited from class com.google.protobuf.AbstractMessage

    findInitializationErrors, getInitializationErrorString, hashFields, toString

    Methods inherited from class com.google.protobuf.AbstractMessageLite

    addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLite

    toByteArray, toByteString, writeDelimitedTo, writeTo

    Methods inherited from interface com.google.protobuf.MessageOrBuilder

    findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
  • Field Details

    • RATING_COUNT_FIELD_NUMBER

      public static final int RATING_COUNT_FIELD_NUMBER
      See Also:
    • AVERAGE_RATING_FIELD_NUMBER

      public static final int AVERAGE_RATING_FIELD_NUMBER
      See Also:
    • RATING_HISTOGRAM_FIELD_NUMBER

      public static final int RATING_HISTOGRAM_FIELD_NUMBER
      See Also:
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage
    • 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 interface RatingOrBuilder
      Returns:
      The ratingCount.
    • 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 interface RatingOrBuilder
      Returns:
      The averageRating.
    • 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 interface RatingOrBuilder
      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 interface RatingOrBuilder
      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 interface RatingOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The ratingHistogram at the given index.
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static Rating parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Rating parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Rating parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Rating parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Rating parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Rating parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Rating parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Rating parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static Rating parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static Rating parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Rating parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Rating parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public Rating.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static Rating.Builder newBuilder()
    • newBuilder

      public static Rating.Builder newBuilder(Rating prototype)
    • toBuilder

      public Rating.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected Rating.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • getDefaultInstance

      public static Rating getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<Rating> parser()
    • getParserForType

      public com.google.protobuf.Parser<Rating> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessage
    • getDefaultInstanceForType

      public Rating getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder