This utility class contains thread-safe static methods.
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Money | |
| public static BigMoney | |
| pack-priv static void | checkNotNull(Object
the object to check, not null object, String message)Validates that the object specified is not null. |
| public static boolean | Returns: true if the money is non-null and negativethe money to check, null returns false moneyProvider)Checks if the monetary value is negative and non-zero, treating null as zero. |
| public static boolean | Returns: true if the money is null, zero or negativethe money to check, null returns true moneyProvider)Checks if the monetary value is negative or zero, treating null as zero. |
| public static boolean | Returns: true if the money is non-null and positivethe money to check, null returns false moneyProvider)Checks if the monetary value is positive and non-zero, treating null as zero. |
| public static boolean | Returns: true if the money is null, zero or positivethe money to check, null returns true moneyProvider)Checks if the monetary value is positive or zero, treating null as zero. |
| public static boolean | Returns: true if the money is null or zerothe money to check, null returns zero moneyProvider)Checks if the monetary value is zero, treating null as zero. |
| public static Money | |
| public static BigMoney | |
| public static Money | |
| public static BigMoney | |
| public static Money | |
| public static BigMoney |
| MoneyUtils | back to summary |
|---|---|
| private MoneyUtils() Private constructor. | |
| add | back to summary |
|---|---|
| public static Money add(Money money1, Money money2) Adds two
This returns
| |
| add | back to summary |
|---|---|
| public static BigMoney add(BigMoney money1, BigMoney money2) Adds two
This returns
| |
| checkNotNull | back to summary |
|---|---|
| pack-priv static void checkNotNull(Object object, String message) Validates that the object specified is not null.
| |
| isNegative | back to summary |
|---|---|
| public static boolean isNegative(BigMoneyProvider moneyProvider) Checks if the monetary value is negative and non-zero, treating null as zero.
This method accepts any implementation of
| |
| isNegativeOrZero | back to summary |
|---|---|
| public static boolean isNegativeOrZero(BigMoneyProvider moneyProvider) Checks if the monetary value is negative or zero, treating null as zero.
This method accepts any implementation of
| |
| isPositive | back to summary |
|---|---|
| public static boolean isPositive(BigMoneyProvider moneyProvider) Checks if the monetary value is positive and non-zero, treating null as zero.
This method accepts any implementation of
| |
| isPositiveOrZero | back to summary |
|---|---|
| public static boolean isPositiveOrZero(BigMoneyProvider moneyProvider) Checks if the monetary value is positive or zero, treating null as zero.
This method accepts any implementation of
| |
| isZero | back to summary |
|---|---|
| public static boolean isZero(BigMoneyProvider moneyProvider) Checks if the monetary value is zero, treating null as zero.
This method accepts any implementation of
| |
| max | back to summary |
|---|---|
| public static Money max(Money money1, Money money2) Finds the maximum This returns the greater of money1 or money2 where null is ignored. If both input values are null, then null is returned.
| |
| max | back to summary |
|---|---|
| public static BigMoney max(BigMoney money1, BigMoney money2) Finds the maximum This returns the greater of money1 or money2 where null is ignored. If both input values are null, then null is returned.
| |
| min | back to summary |
|---|---|
| public static Money min(Money money1, Money money2) Finds the minimum This returns the greater of money1 or money2 where null is ignored. If both input values are null, then null is returned.
| |
| min | back to summary |
|---|---|
| public static BigMoney min(BigMoney money1, BigMoney money2) Finds the minimum This returns the greater of money1 or money2 where null is ignored. If both input values are null, then null is returned.
| |
| subtract | back to summary |
|---|---|
| public static Money subtract(Money money1, Money money2) Subtracts the second
This returns
| |
| subtract | back to summary |
|---|---|
| public static BigMoney subtract(BigMoney money1, BigMoney money2) Subtracts the second
This returns
| |