Package additionalTypes
Class Decimals.Decimal.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderType>
-
- com.google.protobuf.GeneratedMessageV3.Builder<Decimals.Decimal.Builder>
-
- additionalTypes.Decimals.Decimal.Builder
-
- All Implemented Interfaces:
Decimals.DecimalOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- Decimals.Decimal
public static final class Decimals.Decimal.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Decimals.Decimal.Builder> implements Decimals.DecimalOrBuilder
Protobuf standard library / WellKnownTypes don't provide a Decimal type. This posses a challenge to represent Decimals that cannot be accurately represented using float or double types. Related issue: https://github.com/protocolbuffers/protobuf/issues/4406
Protobuf typeadditionalTypes.Decimal
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Decimals.Decimal.BuilderaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)Decimals.Decimalbuild()Decimals.DecimalbuildPartial()Decimals.Decimal.Builderclear()Decimals.Decimal.BuilderclearField(com.google.protobuf.Descriptors.FieldDescriptor field)Decimals.Decimal.BuilderclearFraction()Number of nano (10^9) units of the amount.Decimals.Decimal.BuilderclearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)Decimals.Decimal.BuilderclearPrecision()Represents the precision for the Decimal Precision can only be a positive integer.Decimals.Decimal.BuilderclearScale()Represents the scale for the Decimal Scale can be positive, zero or negative.Decimals.Decimal.BuilderclearUnits()The whole units of the Decimal.Decimals.Decimal.Builderclone()Decimals.DecimalgetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()intgetFraction()Number of nano (10^9) units of the amount.intgetPrecision()Represents the precision for the Decimal Precision can only be a positive integer.intgetScale()Represents the scale for the Decimal Scale can be positive, zero or negative.longgetUnits()The whole units of the Decimal.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()Decimals.Decimal.BuildermergeFrom(Decimals.Decimal other)Decimals.Decimal.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)Decimals.Decimal.BuildermergeFrom(com.google.protobuf.Message other)Decimals.Decimal.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)Decimals.Decimal.BuildersetField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)Decimals.Decimal.BuildersetFraction(int value)Number of nano (10^9) units of the amount.Decimals.Decimal.BuildersetPrecision(int value)Represents the precision for the Decimal Precision can only be a positive integer.Decimals.Decimal.BuildersetRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)Decimals.Decimal.BuildersetScale(int value)Represents the scale for the Decimal Scale can be positive, zero or negative.Decimals.Decimal.BuildersetUnits(long value)The whole units of the Decimal.Decimals.Decimal.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3
-
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeFrom, newUninitializedMessageException
-
-
-
-
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<Decimals.Decimal.Builder>
-
clear
public Decimals.Decimal.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<Decimals.Decimal.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<Decimals.Decimal.Builder>
-
getDefaultInstanceForType
public Decimals.Decimal getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public Decimals.Decimal build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public Decimals.Decimal buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
public Decimals.Decimal.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<Decimals.Decimal.Builder>
-
setField
public Decimals.Decimal.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<Decimals.Decimal.Builder>
-
clearField
public Decimals.Decimal.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Decimals.Decimal.Builder>
-
clearOneof
public Decimals.Decimal.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<Decimals.Decimal.Builder>
-
setRepeatedField
public Decimals.Decimal.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<Decimals.Decimal.Builder>
-
addRepeatedField
public Decimals.Decimal.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<Decimals.Decimal.Builder>
-
mergeFrom
public Decimals.Decimal.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Decimals.Decimal.Builder>
-
mergeFrom
public Decimals.Decimal.Builder mergeFrom(Decimals.Decimal other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<Decimals.Decimal.Builder>
-
mergeFrom
public Decimals.Decimal.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<Decimals.Decimal.Builder>- Throws:
IOException
-
getUnits
public long getUnits()
The whole units of the Decimal. This has to be a whole positive or negative or zero Ex: Units for -89.567800 will be -89
int64 units = 1;- Specified by:
getUnitsin interfaceDecimals.DecimalOrBuilder- Returns:
- The units.
-
setUnits
public Decimals.Decimal.Builder setUnits(long value)
The whole units of the Decimal. This has to be a whole positive or negative or zero Ex: Units for -89.567800 will be -89
int64 units = 1;- Parameters:
value- The units to set.- Returns:
- This builder for chaining.
-
clearUnits
public Decimals.Decimal.Builder clearUnits()
The whole units of the Decimal. This has to be a whole positive or negative or zero Ex: Units for -89.567800 will be -89
int64 units = 1;- Returns:
- This builder for chaining.
-
getFraction
public int getFraction()
Number of nano (10^9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. Ex: -89.5678000 is represented as `units`=-89 and `nanos`=-567,800,000 (-0.567800 * 10^9)
int32 fraction = 2;- Specified by:
getFractionin interfaceDecimals.DecimalOrBuilder- Returns:
- The fraction.
-
setFraction
public Decimals.Decimal.Builder setFraction(int value)
Number of nano (10^9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. Ex: -89.5678000 is represented as `units`=-89 and `nanos`=-567,800,000 (-0.567800 * 10^9)
int32 fraction = 2;- Parameters:
value- The fraction to set.- Returns:
- This builder for chaining.
-
clearFraction
public Decimals.Decimal.Builder clearFraction()
Number of nano (10^9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. Ex: -89.5678000 is represented as `units`=-89 and `nanos`=-567,800,000 (-0.567800 * 10^9)
int32 fraction = 2;- Returns:
- This builder for chaining.
-
getPrecision
public int getPrecision()
Represents the precision for the Decimal Precision can only be a positive integer. Ex: -89.567800 has precision of 8
uint32 precision = 3;- Specified by:
getPrecisionin interfaceDecimals.DecimalOrBuilder- Returns:
- The precision.
-
setPrecision
public Decimals.Decimal.Builder setPrecision(int value)
Represents the precision for the Decimal Precision can only be a positive integer. Ex: -89.567800 has precision of 8
uint32 precision = 3;- Parameters:
value- The precision to set.- Returns:
- This builder for chaining.
-
clearPrecision
public Decimals.Decimal.Builder clearPrecision()
Represents the precision for the Decimal Precision can only be a positive integer. Ex: -89.567800 has precision of 8
uint32 precision = 3;- Returns:
- This builder for chaining.
-
getScale
public int getScale()
Represents the scale for the Decimal Scale can be positive, zero or negative. Ex: -89.567800 has scale of 6 -89.567800 represented with scale=0 is -89 -89.567800 represented with scale=-1 is -80
int32 scale = 4;- Specified by:
getScalein interfaceDecimals.DecimalOrBuilder- Returns:
- The scale.
-
setScale
public Decimals.Decimal.Builder setScale(int value)
Represents the scale for the Decimal Scale can be positive, zero or negative. Ex: -89.567800 has scale of 6 -89.567800 represented with scale=0 is -89 -89.567800 represented with scale=-1 is -80
int32 scale = 4;- Parameters:
value- The scale to set.- Returns:
- This builder for chaining.
-
clearScale
public Decimals.Decimal.Builder clearScale()
Represents the scale for the Decimal Scale can be positive, zero or negative. Ex: -89.567800 has scale of 6 -89.567800 represented with scale=0 is -89 -89.567800 represented with scale=-1 is -80
int32 scale = 4;- Returns:
- This builder for chaining.
-
setUnknownFields
public final Decimals.Decimal.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<Decimals.Decimal.Builder>
-
mergeUnknownFields
public final Decimals.Decimal.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<Decimals.Decimal.Builder>
-
-