You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make Money::with less restritive to support interop with others implementations #113
I had a situation where I needed to implement my own MonetaryAmount (decorated Money) and now Im not able to integrate my code smooth with Money::with because theres a forced cast to Money. Is it possible to relax this and return a MonetaryAmount ?
@OverridepublicMoneywith(MonetaryOperatoroperator) { // <-- Can you return MonetaryAmount ?Objects.requireNonNull(operator);
try {
returnMoney.class.cast(operator.apply(this)); // <-- Can you relax this code ?
} catch (MonetaryExceptione) {
throwe;
} catch (Exceptione) {
thrownewMonetaryException("Operator failed: " + operator, e);
}
}
Activity