Open
Description
Ex.
/**
* Compares two instances of {@link MonetaryAmount}, hereby ignoring non significant trailing
* zeroes and different numeric capabilities.
*
* @param amount the {@link MonetaryAmount} to be compared with this instance.
* @return {@code true} if {@code amount < this}.
* @throws MonetaryException if the amount's currency is not equal to the currency of this instance.
*/
boolean isLessThan(MonetaryAmount amount);
The java doc says that it returns true if amount < this
, but every implementation (and a personal reading of this.isLessThan(amount)
seems like it should) returns true if this < amount
.
Ex with the reference moneta implementation
System.out.println(Money.of(BigDecimal.ONE, Monetary.getCurrency("USD"))
.isLessThan(Money.of(BigDecimal.TEN, Monetary.getCurrency("USD"))));
true