Done ticket GEPAFINBE-3

This commit is contained in:
harish
2024-08-14 15:31:00 +05:30
parent 2773dfa034
commit e09f61f918
51 changed files with 2107 additions and 70 deletions

View File

@@ -0,0 +1,20 @@
package net.gepafin.tendermanagement.util;
import java.util.function.Consumer;
import java.util.function.Supplier;
public class ObjectUtils {
public static <T> void setIfNotNull(Consumer<T> setter, T value) {
if (value != null) {
setter.accept(value);
}
}
public static <T> void setIfUpdated(Supplier<T> getter, Consumer<T> setter, T newValue) {
T currentValue = getter.get();
if (newValue != null && !newValue.equals(currentValue)) {
setter.accept(newValue);
}
}
}