FINERACT-2190: Improve copyFrom of LoanRepaymentScheduleInstallment

This commit is contained in:
Adam Saghy
2025-04-04 14:29:10 +02:00
parent 52c41b1471
commit eb7ec383f8
7 changed files with 153 additions and 217 deletions
@@ -39,8 +39,8 @@ public final class MathUtil {
return nullToDefault(value, 0L);
}
public static Long nullToDefault(Long value, Long def) {
return value == null ? def : value;
public static Integer nullToZero(Integer value) {
return nullToDefault(value, 0);
}
public static Long zeroToNull(Long value) {
@@ -505,4 +505,8 @@ public final class MathUtil {
return notNull ? first == null ? second : second == null ? first : max(first, second, false)
: isGreaterThan(first, second) ? first : second;
}
public static boolean isEqualTo(Integer first, Integer second) {
return nullToZero(first).equals(nullToZero(second));
}
}