Class Money
- java.lang.Object
-
- java.util.AbstractMap<java.lang.String,java.lang.Object>
-
- com.google.api.client.util.GenericData
-
- com.google.api.client.json.GenericJson
-
- com.google.api.services.rcsbusinessmessaging.v1.model.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.GenericJsonRepresents 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
-
-
Constructor Summary
Constructors Constructor Description Money()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Moneyclone()java.lang.StringgetCurrencyCode()The three-letter currency code defined in ISO 4217.java.lang.IntegergetNanos()Number of nano (10^-9) units of the amount.java.lang.LonggetUnits()The whole units of the amount.Moneyset(java.lang.String fieldName, java.lang.Object value)MoneysetCurrencyCode(java.lang.String currencyCode)The three-letter currency code defined in ISO 4217.MoneysetNanos(java.lang.Integer nanos)Number of nano (10^-9) units of the amount.MoneysetUnits(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
-
-
-
-
Method Detail
-
getCurrencyCode
public java.lang.String getCurrencyCode()
The three-letter currency code defined in ISO 4217.- Returns:
- value or
nullfor none
-
setCurrencyCode
public Money setCurrencyCode(java.lang.String currencyCode)
The three-letter currency code defined in ISO 4217.- Parameters:
currencyCode- currencyCode ornullfor 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
nullfor 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 ornullfor 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
nullfor 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 ornullfor none
-
set
public Money set(java.lang.String fieldName, java.lang.Object value)
- Overrides:
setin classcom.google.api.client.json.GenericJson
-
clone
public Money clone()
- Overrides:
clonein classcom.google.api.client.json.GenericJson
-
-