Code example for BigDecimal

Methods: equals

0
		if (!(o instanceof MonetaryAmount)) return false;
 
		final MonetaryAmount monetaryAmount = (MonetaryAmount) o;
 
		if (!currency.equals(monetaryAmount.currency)) return false;
		if (!value.equals(monetaryAmount.value)) return false;
 
		return true; 
	} 
 
	public int hashCode() { 
		int result;
		result = value.hashCode();
		result = 29 * result + currency.hashCode();
		return result;
	} 
 
	public String toString() {
		return "Value: '" + getValue() + "', " + 
		        "Currency: '" + getCurrency() + "'"; 
	}