Package io.inugami.api.functionnals
Class FunctionalUtils
- java.lang.Object
-
- io.inugami.api.functionnals.FunctionalUtils
-
public final class FunctionalUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description FunctionalUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanapplyIfChange(boolean ref, boolean newValue, Consumer<Boolean> consumer)static booleanapplyIfChange(double ref, double newValue, DoubleConsumer consumer)static booleanapplyIfChange(float ref, float newValue, Consumer<Float> consumer)static booleanapplyIfChange(int ref, int newValue, IntConsumer consumer)static booleanapplyIfChange(long ref, long newValue, LongConsumer consumer)static booleanapplyIfChange(short ref, short newValue, Consumer<Short> consumer)static <T> booleanapplyIfChange(T ref, T newValue, Consumer<T> consumer)static <T> booleanapplyIfChangeAndNotNull(T ref, T newValue, Consumer<T> consumer)static StringapplyIfEmpty(String data, Supplier<String> supplier)static <T extends Collection<?>>
TapplyIfEmpty(T data, Supplier<T> supplier)static StringapplyIfNotEmpty(String data, Supplier<String> supplier)static <T extends Collection<?>>
TapplyIfNotEmpty(T data, Supplier<T> supplier)static <T> booleanapplyIfNotNull(T data, Consumer<T> consumer)static <T> booleanapplyIfNotNull(T data, T defaultValue, Consumer<T> consumer)static <T> TapplyIfNull(T data, Supplier<T> supplier)protected static <T> booleanhasChange(T ref, T newValue)static StringorNull(String data)static <T> voidprocessIfNotNull(T object, VoidFunction supplier)static <T> voidprocessIfNotNull(T object, Consumer<T> supplier)static <T> voidprocessIfNull(T object, VoidFunction supplier)
-
-
-
Method Detail
-
applyIfNotNull
public static <T> boolean applyIfNotNull(T data, Consumer<T> consumer)
-
applyIfNotNull
public static <T> boolean applyIfNotNull(T data, T defaultValue, Consumer<T> consumer)
-
processIfNull
public static <T> void processIfNull(T object, VoidFunction supplier)
-
processIfNotNull
public static <T> void processIfNotNull(T object, VoidFunction supplier)
-
processIfNotNull
public static <T> void processIfNotNull(T object, Consumer<T> supplier)
-
applyIfNull
public static <T> T applyIfNull(T data, Supplier<T> supplier)
-
applyIfEmpty
public static <T extends Collection<?>> T applyIfEmpty(T data, Supplier<T> supplier)
-
applyIfNotEmpty
public static <T extends Collection<?>> T applyIfNotEmpty(T data, Supplier<T> supplier)
-
applyIfNotEmpty
public static <T extends Map<?,?>> T applyIfNotEmpty(T data, Supplier<T> supplier)
-
applyIfChange
public static boolean applyIfChange(boolean ref, boolean newValue, Consumer<Boolean> consumer)
-
applyIfChange
public static boolean applyIfChange(short ref, short newValue, Consumer<Short> consumer)
-
applyIfChange
public static boolean applyIfChange(int ref, int newValue, IntConsumer consumer)
-
applyIfChange
public static boolean applyIfChange(float ref, float newValue, Consumer<Float> consumer)
-
applyIfChange
public static boolean applyIfChange(long ref, long newValue, LongConsumer consumer)
-
applyIfChange
public static boolean applyIfChange(double ref, double newValue, DoubleConsumer consumer)
-
applyIfChange
public static <T> boolean applyIfChange(T ref, T newValue, Consumer<T> consumer)
-
applyIfChangeAndNotNull
public static <T> boolean applyIfChangeAndNotNull(T ref, T newValue, Consumer<T> consumer)
-
hasChange
protected static <T> boolean hasChange(T ref, T newValue)
-
-