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
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);
}
}
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 ?
Initially I had open this issue in JavaMoney/jsr354-ri#190 and @marschall suggested to discuss it here.
The text was updated successfully, but these errors were encountered: