Class Decimal

  • All Implemented Interfaces:
    com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, DecimalOrBuilder, Serializable

    public final class Decimal
    extends com.google.protobuf.GeneratedMessageV3
    implements DecimalOrBuilder
     A representation of a decimal value, such as 2.5. Clients may convert values
     into language-native decimal formats, such as Java's [BigDecimal][] or
     Python's [decimal.Decimal][].
     [BigDecimal]:
     https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/math/BigDecimal.html
     [decimal.Decimal]: https://docs.python.org/3/library/decimal.html
     
    Protobuf type google.type.Decimal
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Decimal.Builder
      A representation of a decimal value, such as 2.5.
      • Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3

        com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,​BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,​BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
      • Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

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

      Fields 
      Modifier and Type Field Description
      static int VALUE_FIELD_NUMBER  
      • Fields inherited from class com.google.protobuf.GeneratedMessageV3

        alwaysUseFieldBuilders, unknownFields
      • Fields inherited from class com.google.protobuf.AbstractMessage

        memoizedSize
      • Fields inherited from class com.google.protobuf.AbstractMessageLite

        memoizedHashCode
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(Object obj)  
      static Decimal getDefaultInstance()  
      Decimal getDefaultInstanceForType()  
      static com.google.protobuf.Descriptors.Descriptor getDescriptor()  
      com.google.protobuf.Parser<Decimal> getParserForType()  
      int getSerializedSize()  
      com.google.protobuf.UnknownFieldSet getUnknownFields()  
      String getValue()
      The decimal value, as a string.
      com.google.protobuf.ByteString getValueBytes()
      The decimal value, as a string.
      int hashCode()  
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()  
      boolean isInitialized()  
      static Decimal.Builder newBuilder()  
      static Decimal.Builder newBuilder​(Decimal prototype)  
      Decimal.Builder newBuilderForType()  
      protected Decimal.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)  
      protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)  
      static Decimal parseDelimitedFrom​(InputStream input)  
      static Decimal parseDelimitedFrom​(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static Decimal parseFrom​(byte[] data)  
      static Decimal parseFrom​(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static Decimal parseFrom​(com.google.protobuf.ByteString data)  
      static Decimal parseFrom​(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static Decimal parseFrom​(com.google.protobuf.CodedInputStream input)  
      static Decimal parseFrom​(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static Decimal parseFrom​(InputStream input)  
      static Decimal parseFrom​(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static Decimal parseFrom​(ByteBuffer data)  
      static Decimal parseFrom​(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static com.google.protobuf.Parser<Decimal> parser()  
      Decimal.Builder toBuilder()  
      void writeTo​(com.google.protobuf.CodedOutputStream output)  
      • Methods inherited from class com.google.protobuf.GeneratedMessageV3

        canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, 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, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
      • Methods inherited from class com.google.protobuf.AbstractMessageLite

        addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
      • 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, hasField, hasOneof
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getUnknownFields

        public final com.google.protobuf.UnknownFieldSet getUnknownFields()
        Specified by:
        getUnknownFields in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getUnknownFields in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

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

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • getValue

        public String getValue()
         The decimal value, as a string.
         The string representation consists of an optional sign, `+` (`U+002B`)
         or `-` (`U+002D`), followed by a sequence of zero or more decimal digits
         ("the integer"), optionally followed by a fraction, optionally followed
         by an exponent.
         The fraction consists of a decimal point followed by zero or more decimal
         digits. The string must contain at least one digit in either the integer
         or the fraction. The number formed by the sign, the integer and the
         fraction is referred to as the significand.
         The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`)
         followed by one or more decimal digits.
         Services **should** normalize decimal values before storing them by:
           - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
           - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
           - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
           - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
         Services **may** perform additional normalization based on its own needs
         and the internal decimal implementation selected, such as shifting the
         decimal point and exponent value together (example: `2.5e-1` <-> `0.25`).
         Additionally, services **may** preserve trailing zeroes in the fraction
         to indicate increased precision, but are not required to do so.
         Note that only the `.` character is supported to divide the integer
         and the fraction; `,` **should not** be supported regardless of locale.
         Additionally, thousand separators **should not** be supported. If a
         service does support them, values **must** be normalized.
         The ENBF grammar is:
             DecimalString =
               [Sign] Significand [Exponent];
             Sign = '+' | '-';
             Significand =
               Digits ['.'] [Digits] | [Digits] '.' Digits;
             Exponent = ('e' | 'E') [Sign] Digits;
             Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
         Services **should** clearly document the range of supported values, the
         maximum supported precision (total number of digits), and, if applicable,
         the scale (number of digits after the decimal point), as well as how it
         behaves when receiving out-of-bounds values.
         Services **may** choose to accept values passed as input even when the
         value has a higher precision or scale than the service supports, and
         **should** round the value to fit the supported scale. Alternatively, the
         service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC)
         if precision would be lost.
         Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in
         gRPC) if the service receives a value outside of the supported range.
         
        string value = 1;
        Specified by:
        getValue in interface DecimalOrBuilder
        Returns:
        The value.
      • getValueBytes

        public com.google.protobuf.ByteString getValueBytes()
         The decimal value, as a string.
         The string representation consists of an optional sign, `+` (`U+002B`)
         or `-` (`U+002D`), followed by a sequence of zero or more decimal digits
         ("the integer"), optionally followed by a fraction, optionally followed
         by an exponent.
         The fraction consists of a decimal point followed by zero or more decimal
         digits. The string must contain at least one digit in either the integer
         or the fraction. The number formed by the sign, the integer and the
         fraction is referred to as the significand.
         The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`)
         followed by one or more decimal digits.
         Services **should** normalize decimal values before storing them by:
           - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
           - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
           - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
           - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
         Services **may** perform additional normalization based on its own needs
         and the internal decimal implementation selected, such as shifting the
         decimal point and exponent value together (example: `2.5e-1` <-> `0.25`).
         Additionally, services **may** preserve trailing zeroes in the fraction
         to indicate increased precision, but are not required to do so.
         Note that only the `.` character is supported to divide the integer
         and the fraction; `,` **should not** be supported regardless of locale.
         Additionally, thousand separators **should not** be supported. If a
         service does support them, values **must** be normalized.
         The ENBF grammar is:
             DecimalString =
               [Sign] Significand [Exponent];
             Sign = '+' | '-';
             Significand =
               Digits ['.'] [Digits] | [Digits] '.' Digits;
             Exponent = ('e' | 'E') [Sign] Digits;
             Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
         Services **should** clearly document the range of supported values, the
         maximum supported precision (total number of digits), and, if applicable,
         the scale (number of digits after the decimal point), as well as how it
         behaves when receiving out-of-bounds values.
         Services **may** choose to accept values passed as input even when the
         value has a higher precision or scale than the service supports, and
         **should** round the value to fit the supported scale. Alternatively, the
         service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC)
         if precision would be lost.
         Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in
         gRPC) if the service receives a value outside of the supported range.
         
        string value = 1;
        Specified by:
        getValueBytes in interface DecimalOrBuilder
        Returns:
        The bytes for value.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • 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.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • 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 Decimal parseFrom​(ByteBuffer data)
                                 throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

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

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

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

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

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

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

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

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

        protected Decimal.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static Decimal getDefaultInstance()
      • parser

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

        public com.google.protobuf.Parser<Decimal> 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.GeneratedMessageV3
      • getDefaultInstanceForType

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