Class FunctionalUtils


  • public final class FunctionalUtils
    extends Object
    • Constructor Detail

      • FunctionalUtils

        public FunctionalUtils()
    • 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)
      • applyIfEmpty

        public static <T extends Map<?,​?>> 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)