Class Money

  • All Implemented Interfaces:
    java.lang.Cloneable, java.util.Map<java.lang.String,​java.lang.Object>

    public final class Money
    extends com.google.api.client.json.GenericJson
    Represents an amount of money with its currency type.

    This is the Java data model class that specifies how to parse/serialize into the JSON that is transmitted over HTTP when working with the RCS Business Messaging API. For a detailed explanation see: https://developers.google.com/api-client-library/java/google-http-java-client/json

    Author:
    Google, Inc.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.google.api.client.util.GenericData

        com.google.api.client.util.GenericData.Flags
      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      Money()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Money clone()  
      java.lang.String getCurrencyCode()
      The three-letter currency code defined in ISO 4217.
      java.lang.Integer getNanos()
      Number of nano (10^-9) units of the amount.
      java.lang.Long getUnits()
      The whole units of the amount.
      Money set​(java.lang.String fieldName, java.lang.Object value)  
      Money setCurrencyCode​(java.lang.String currencyCode)
      The three-letter currency code defined in ISO 4217.
      Money setNanos​(java.lang.Integer nanos)
      Number of nano (10^-9) units of the amount.
      Money setUnits​(java.lang.Long units)
      The whole units of the amount.
      • Methods inherited from class com.google.api.client.json.GenericJson

        getFactory, setFactory, toPrettyString, toString
      • Methods inherited from class com.google.api.client.util.GenericData

        entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeys
      • Methods inherited from class java.util.AbstractMap

        clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, values
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Constructor Detail

      • Money

        public Money()
    • Method Detail

      • getCurrencyCode

        public java.lang.String getCurrencyCode()
        The three-letter currency code defined in ISO 4217.
        Returns:
        value or null for none
      • setCurrencyCode

        public Money setCurrencyCode​(java.lang.String currencyCode)
        The three-letter currency code defined in ISO 4217.
        Parameters:
        currencyCode - currencyCode or null for none
      • getNanos

        public java.lang.Integer 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.
        Returns:
        value or null for none
      • setNanos

        public Money setNanos​(java.lang.Integer nanos)
        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.
        Parameters:
        nanos - nanos or null for none
      • getUnits

        public java.lang.Long getUnits()
        The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
        Returns:
        value or null for none
      • setUnits

        public Money setUnits​(java.lang.Long units)
        The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
        Parameters:
        units - units or null for none
      • set

        public Money set​(java.lang.String fieldName,
                         java.lang.Object value)
        Overrides:
        set in class com.google.api.client.json.GenericJson
      • clone

        public Money clone()
        Overrides:
        clone in class com.google.api.client.json.GenericJson