@ Override public int compareTo ( BigMoneyProvider other ) { BigMoney otherMoney = of ( other ) ; if ( currency . equals ( otherMoney . currency ) == false ) { throw new CurrencyMismatchException ( getCurrencyUnit ( ) , otherMoney . getCurrencyUnit ( ) ) ; } return amount . compareTo ( otherMoney . amount ) ; }
Compares this monetary value to another . The compared values must be in the same currency .