FINERACT-2326: Improve null-safety

This commit is contained in:
Adam Saghy
2025-08-13 11:02:22 +02:00
parent 53d9790c8c
commit c2519c77c7
6 changed files with 468 additions and 128 deletions
@@ -335,6 +335,10 @@ public final class MathUtil {
return nullToDefault(value, Money.zero(currency));
}
public static Money nullToZero(Money value, @NotNull MonetaryCurrency currency, @NotNull MathContext mc) {
return nullToDefault(value, Money.zero(currency, mc));
}
public static Money nullToDefault(Money value, Money def) {
return value == null ? def : value;
}