Java Code Examples for org.joda.money.Money#getCurrencyUnit()
The following examples show how to use
org.joda.money.Money#getCurrencyUnit() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BigDecimalColumnMoneyMapper.java From jadira with Apache License 2.0 | 5 votes |
@Override public BigDecimal toNonNullValue(Money value) { if (!currencyUnit.equals(value.getCurrencyUnit())) { throw new IllegalStateException("Expected currency " + currencyUnit.getCurrencyCode() + " but was " + value.getCurrencyUnit()); } return value.getAmount(); }
Example 2
Source File: LongColumnMoneyMinorMapper.java From jadira with Apache License 2.0 | 5 votes |
@Override public Long toNonNullValue(Money value) { if (!currencyUnit.equals(value.getCurrencyUnit())) { throw new IllegalStateException("Expected currency " + currencyUnit.getCurrencyCode() + " but was " + value.getCurrencyUnit()); } return value.getAmountMinorLong(); }
Example 3
Source File: LongColumnMoneyMajorMapper.java From jadira with Apache License 2.0 | 5 votes |
@Override public Long toNonNullValue(Money value) { if (!currencyUnit.equals(value.getCurrencyUnit())) { throw new IllegalStateException("Expected currency " + currencyUnit.getCurrencyCode() + " but was " + value.getCurrencyUnit()); } return value.getAmountMajorLong(); }
Example 4
Source File: PersistentMoneyAmountAndCurrencyAsInteger.java From jadira with Apache License 2.0 | 4 votes |
@Override protected Object[] toConvertedColumns(Money value) { return new Object[] { value.getCurrencyUnit(), value.getAmount() }; }
Example 5
Source File: PersistentMoneyAmountAndCurrency.java From jadira with Apache License 2.0 | 4 votes |
@Override protected Object[] toConvertedColumns(Money value) { return new Object[] { value.getCurrencyUnit(), value.getAmount() }; }
Example 6
Source File: PersistentMoneyMinorAmountAndCurrency.java From jadira with Apache License 2.0 | 4 votes |
@Override protected Object[] toConvertedColumns(Money value) { return new Object[] { value.getCurrencyUnit(), value.getAmountMinorLong() }; }
Example 7
Source File: PersistentMoneyMajorAmountAndCurrencyAsInteger.java From jadira with Apache License 2.0 | 4 votes |
@Override protected Object[] toConvertedColumns(Money value) { return new Object[] { value.getCurrencyUnit(), value.getAmountMajorLong() }; }
Example 8
Source File: PersistentMoneyMajorAmountAndCurrency.java From jadira with Apache License 2.0 | 4 votes |
@Override protected Object[] toConvertedColumns(Money value) { return new Object[] { value.getCurrencyUnit(), value.getAmountMajorLong() }; }
Example 9
Source File: PersistentMoneyMinorAmountAndCurrencyAsInteger.java From jadira with Apache License 2.0 | 4 votes |
@Override protected Object[] toConvertedColumns(Money value) { return new Object[] { value.getCurrencyUnit(), value.getAmountMinorLong() }; }