use of org.javamoney.moneta.Money in project jsr354-ri by JavaMoney.
the class StreamFactory method streamNull.
public static Stream<MonetaryAmount> streamNull() {
Money m1 = Money.of(BigDecimal.TEN, BRAZILIAN_REAL);
Money m2 = Money.of(BigDecimal.ZERO, BRAZILIAN_REAL);
Money m3 = Money.of(BigDecimal.ONE, BRAZILIAN_REAL);
Money m4 = Money.of(BigDecimal.valueOf(4L), BRAZILIAN_REAL);
Money m5 = Money.of(BigDecimal.valueOf(5L), BRAZILIAN_REAL);
return Stream.of(m1, m2, m3, m4, m5, null);
}
use of org.javamoney.moneta.Money in project jsr354-ri by JavaMoney.
the class StreamFactory method streamCurrencyDifferent.
public static Stream<MonetaryAmount> streamCurrencyDifferent() {
Money m1 = Money.of(BigDecimal.TEN, BRAZILIAN_REAL);
Money m2 = Money.of(BigDecimal.ZERO, BRAZILIAN_REAL);
Money m3 = Money.of(BigDecimal.ONE, BRAZILIAN_REAL);
Money m4 = Money.of(BigDecimal.valueOf(4L), EURO);
Money m5 = Money.of(BigDecimal.valueOf(5L), BRAZILIAN_REAL);
return Stream.of(m1, m2, m3, m4, m5);
}
use of org.javamoney.moneta.Money in project jsr354-ri by JavaMoney.
the class StreamFactory method streamNormal.
public static Stream<MonetaryAmount> streamNormal() {
Money m1 = Money.of(BigDecimal.TEN, BRAZILIAN_REAL);
Money m2 = Money.of(BigDecimal.ZERO, BRAZILIAN_REAL);
Money m3 = Money.of(BigDecimal.ONE, BRAZILIAN_REAL);
Money m4 = Money.of(BigDecimal.valueOf(4L), BRAZILIAN_REAL);
Money m5 = Money.of(BigDecimal.valueOf(5L), BRAZILIAN_REAL);
return Stream.of(m1, m2, m3, m4, m5);
}
use of org.javamoney.moneta.Money in project jsr354-ri by JavaMoney.
the class StreamFactory method currencies.
public static Stream<MonetaryAmount> currencies() {
Money r1 = Money.of(BigDecimal.TEN, BRAZILIAN_REAL);
Money r2 = Money.of(BigDecimal.ZERO, BRAZILIAN_REAL);
Money r3 = Money.of(BigDecimal.ONE, BRAZILIAN_REAL);
Money e1 = Money.of(BigDecimal.TEN, EURO);
Money e2 = Money.of(BigDecimal.ZERO, EURO);
Money e3 = Money.of(BigDecimal.ONE, EURO);
Money d1 = Money.of(BigDecimal.TEN, DOLLAR);
Money d2 = Money.of(BigDecimal.ZERO, DOLLAR);
Money d3 = Money.of(BigDecimal.ONE, DOLLAR);
return Stream.of(r1, r2, r3, e1, e2, e3, d1, d2, d3);
}
use of org.javamoney.moneta.Money in project rulesservice by genny-project.
the class MoneyHelper method sub.
public static Money sub(Money inputMoney, Number number) {
Money result = Money.of(0, DEFAULT_CURRENCY);
if (inputMoney != null && number != null) {
Number numberFromMoney = inputMoney.getNumber();
Number resultNumber = sub(numberFromMoney, number);
result = Money.of(resultNumber, inputMoney.getCurrency());
}
return result;
}
Aggregations