Class Money.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<MessageType,BuilderType>
com.google.protobuf.GeneratedMessageLite.Builder<Money,Money.Builder>
com.google.type.Money.Builder
All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, MoneyOrBuilder, Cloneable
Enclosing class:
Money

public static final class Money.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<Money,Money.Builder> implements MoneyOrBuilder
 Represents an amount of money with its currency type.
 
Protobuf type google.type.Money
  • Field Summary

    Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder

    instance
  • Method Summary

    Modifier and Type
    Method
    Description
    The three-letter currency code defined in ISO 4217.
    Number of nano (10^-9) units of the amount.
    The whole units of the amount.
    The three-letter currency code defined in ISO 4217.
    com.google.protobuf.ByteString
    The three-letter currency code defined in ISO 4217.
    int
    Number of nano (10^-9) units of the amount.
    long
    The whole units of the amount.
    The three-letter currency code defined in ISO 4217.
    setCurrencyCodeBytes(com.google.protobuf.ByteString value)
    The three-letter currency code defined in ISO 4217.
    setNanos(int value)
    Number of nano (10^-9) units of the amount.
    setUnits(long value)
    The whole units of the amount.

    Methods inherited from class com.google.protobuf.GeneratedMessageLite.Builder

    build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFrom

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder

    getDefaultInstanceForType, isInitialized
  • Method Details

    • getCurrencyCode

      public String getCurrencyCode()
       The three-letter currency code defined in ISO 4217.
       
      string currency_code = 1 [json_name = "currencyCode"];
      Specified by:
      getCurrencyCode in interface MoneyOrBuilder
      Returns:
      The currencyCode.
    • getCurrencyCodeBytes

      public com.google.protobuf.ByteString getCurrencyCodeBytes()
       The three-letter currency code defined in ISO 4217.
       
      string currency_code = 1 [json_name = "currencyCode"];
      Specified by:
      getCurrencyCodeBytes in interface MoneyOrBuilder
      Returns:
      The bytes for currencyCode.
    • setCurrencyCode

      public Money.Builder setCurrencyCode(String value)
       The three-letter currency code defined in ISO 4217.
       
      string currency_code = 1 [json_name = "currencyCode"];
      Parameters:
      value - The currencyCode to set.
      Returns:
      This builder for chaining.
    • clearCurrencyCode

      public Money.Builder clearCurrencyCode()
       The three-letter currency code defined in ISO 4217.
       
      string currency_code = 1 [json_name = "currencyCode"];
      Returns:
      This builder for chaining.
    • setCurrencyCodeBytes

      public Money.Builder setCurrencyCodeBytes(com.google.protobuf.ByteString value)
       The three-letter currency code defined in ISO 4217.
       
      string currency_code = 1 [json_name = "currencyCode"];
      Parameters:
      value - The bytes for currencyCode to set.
      Returns:
      This builder for chaining.
    • getUnits

      public long getUnits()
       The whole units of the amount.
       For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
       
      int64 units = 2 [json_name = "units"];
      Specified by:
      getUnits in interface MoneyOrBuilder
      Returns:
      The units.
    • setUnits

      public Money.Builder setUnits(long value)
       The whole units of the amount.
       For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
       
      int64 units = 2 [json_name = "units"];
      Parameters:
      value - The units to set.
      Returns:
      This builder for chaining.
    • clearUnits

      public Money.Builder clearUnits()
       The whole units of the amount.
       For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
       
      int64 units = 2 [json_name = "units"];
      Returns:
      This builder for chaining.
    • getNanos

      public int getNanos()
       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.
       For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
       
      int32 nanos = 3 [json_name = "nanos"];
      Specified by:
      getNanos in interface MoneyOrBuilder
      Returns:
      The nanos.
    • setNanos

      public Money.Builder setNanos(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.
       For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
       
      int32 nanos = 3 [json_name = "nanos"];
      Parameters:
      value - The nanos to set.
      Returns:
      This builder for chaining.
    • clearNanos

      public Money.Builder clearNanos()
       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.
       For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
       
      int32 nanos = 3 [json_name = "nanos"];
      Returns:
      This builder for chaining.