FINERACT-2190: Improve copyFrom of LoanRepaymentScheduleInstallment
This commit is contained in:
+6
-2
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user