Class MoneyUtil
- java.lang.Object
-
- com.aoindustries.aoserv.client.billing.MoneyUtil
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MoneygetDto(Money money)null-safe getDto for Money.static MoneygetMoney(Money money)null-safe money conversion.static MoneygetMoney(ResultSet result, String currencyColumnLabel, String valueColumnLabel)static MoneygetMoney(Currency currency, BigDecimal value)null-safe money conversion.static MoneyreadMoney(StreamableInput in)static MoneyreadNullMoney(StreamableInput in)static voidwriteMoney(Money money, StreamableOutput out)static voidwriteNullMoney(Money money, StreamableOutput out)
-
-
-
Method Detail
-
getMoney
public static Money getMoney(Currency currency, BigDecimal value)
null-safe money conversion.
-
getMoney
public static Money getMoney(ResultSet result, String currencyColumnLabel, String valueColumnLabel) throws SQLException
Gets aMoneytype from two columns of aResultSet. Supportsnull. If value is non-null then currency must also be non-null.- Throws:
SQLException
-
writeMoney
public static void writeMoney(Money money, StreamableOutput out) throws IOException
- Throws:
IOException
-
writeNullMoney
public static void writeNullMoney(Money money, StreamableOutput out) throws IOException
- Throws:
IOException
-
readMoney
public static Money readMoney(StreamableInput in) throws IOException
- Throws:
IOException
-
readNullMoney
public static Money readNullMoney(StreamableInput in) throws IOException
- Throws:
IOException
-
-