public final class Moneys
extends java.lang.Object
Money instances.| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_NANOS |
| Modifier and Type | Method and Description |
|---|---|
static com.google.type.Money |
add(com.google.type.Money a,
com.google.type.Money b)
Add two instances of
Money. |
static com.google.type.Money |
add(com.google.type.Money a,
com.google.type.Money b,
boolean allowOverflow)
Add two instances of
Money. |
static void |
checkValid(com.google.type.Money value)
Determine if an instance of
Money is valid. |
public static void checkValid(com.google.type.Money value)
Money is valid.value - an instance of Moneyjava.lang.IllegalArgumentException - if money is invalidpublic static com.google.type.Money add(com.google.type.Money a,
com.google.type.Money b,
boolean allowOverflow)
Money.
Allows the value to overflow.a - an instance of Moneyb - an instance of MoneyallowOverflow - indicates that overflow is allowedMoney representing the sumjava.lang.IllegalArgumentException - if the two instances cannot be summedjava.lang.ArithmeticException - if overflow occurs when it's not allowedpublic static com.google.type.Money add(com.google.type.Money a,
com.google.type.Money b)
Money.
The sum is not allowed to overflow.a - an instance of Moneyb - an instance of MoneyMoney representing the sumjava.lang.IllegalArgumentException - if the two instances cannot be summedjava.lang.ArithmeticException - if overflow occurs when it's not allowed