Class Decimal.Builder

  • All Implemented Interfaces:
    com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<com.google.protobuf.GeneratedMessageV3>, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, DecimalOrBuilder, java.lang.Cloneable
    Enclosing class:
    Decimal

    public static final class Decimal.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<Decimal.Builder>
    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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Decimal.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)  
      Decimal build()  
      Decimal buildPartial()  
      Decimal.Builder clear()  
      Decimal.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)  
      Decimal.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)  
      Decimal.Builder clearValue()
      The decimal value, as a string.
      Decimal.Builder clone()  
      Decimal getDefaultInstanceForType()  
      static com.google.protobuf.Descriptors.Descriptor getDescriptor()  
      com.google.protobuf.Descriptors.Descriptor getDescriptorForType()  
      java.lang.String getValue()
      The decimal value, as a string.
      com.google.protobuf.ByteString getValueBytes()
      The decimal value, as a string.
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()  
      boolean isInitialized()  
      Decimal.Builder mergeFrom​(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      Decimal.Builder mergeFrom​(com.google.protobuf.Message other)  
      Decimal.Builder mergeFrom​(Decimal other)  
      Decimal.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)  
      Decimal.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)  
      Decimal.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)  
      Decimal.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)  
      Decimal.Builder setValue​(java.lang.String value)
      The decimal value, as a string.
      Decimal.Builder setValueBytes​(com.google.protobuf.ByteString value)
      The decimal value, as a string.
      • Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder

        getParentForChildren
      • Methods inherited from class com.google.protobuf.GeneratedMessage.ExtendableBuilder

        addExtension, clearExtension, extensionsAreInitialized, getAllFields, getExtension, getExtension, getExtensionCount, getField, getFieldBuilder, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, hasExtension, hasField, mergeExtensionFields, newBuilderForField, parseUnknownField, setExtension, setExtension
      • Methods inherited from class com.google.protobuf.GeneratedMessage.Builder

        getOneofFieldDescriptor, getUnknownFields, getUnknownFieldSetBuilder, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, onBuilt, onChanged, 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
      • Methods inherited from interface com.google.protobuf.Message.Builder

        mergeDelimitedFrom, mergeDelimitedFrom
      • Methods inherited from interface com.google.protobuf.MessageLite.Builder

        mergeFrom
      • Methods inherited from interface com.google.protobuf.MessageOrBuilder

        findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
    • Method Detail

      • getDescriptor

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

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Overrides:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<Decimal.Builder>
      • clear

        public Decimal.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<Decimal.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<Decimal.Builder>
      • getDefaultInstanceForType

        public Decimal getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<com.google.protobuf.GeneratedMessageV3>
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

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

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

        public Decimal.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<Decimal.Builder>
      • setField

        public Decimal.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                        java.lang.Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<Decimal.Builder>
      • clearField

        public Decimal.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<Decimal.Builder>
      • clearOneof

        public Decimal.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Decimal.Builder>
      • setRepeatedField

        public Decimal.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                int index,
                                                java.lang.Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Decimal.Builder>
      • addRepeatedField

        public Decimal.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                java.lang.Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Decimal.Builder>
      • mergeFrom

        public Decimal.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Decimal.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessage.ExtendableBuilder<com.google.protobuf.GeneratedMessageV3,​Decimal.Builder>
      • mergeFrom

        public Decimal.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                  throws java.io.IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Decimal.Builder>
        Throws:
        java.io.IOException
      • getValue

        public java.lang.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.
      • setValue

        public Decimal.Builder setValue​(java.lang.String value)
         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;
        Parameters:
        value - The value to set.
        Returns:
        This builder for chaining.
      • clearValue

        public Decimal.Builder clearValue()
         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;
        Returns:
        This builder for chaining.
      • setValueBytes

        public Decimal.Builder setValueBytes​(com.google.protobuf.ByteString value)
         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;
        Parameters:
        value - The bytes for value to set.
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final Decimal.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Decimal.Builder>
      • mergeUnknownFields

        public final Decimal.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Decimal.Builder>