程序包 dev.utils.common

类 ForUtils


  • public final class ForUtils
    extends java.lang.Object
    detail: 循环工具类
    作者:
    Ttt
    • 方法详细资料

      • forArgs

        public static <T> boolean forArgs​(ForUtils.Consumer<T> action,
                                          T... args)
        循环可变数组
        类型参数:
        T - 泛型
        参数:
        action - 循环消费对象
        args - 参数
        返回:
        true success, false fail
      • forArgs

        public static <T> boolean forArgs​(ForUtils.Consumer<T> action,
                                          boolean checkLength,
                                          T... args)
        循环可变数组
             基础类型需要传入包装类型, 如 int 传入为 Integer 为泛型类型
         
        类型参数:
        T - 泛型
        参数:
        action - 循环消费对象
        checkLength - 是否检查长度
        args - 参数
        返回:
        true success, false fail
      • forSimpleArgs

        public static <T> boolean forSimpleArgs​(ForUtils.ConsumerSimple<T> action,
                                                T... args)
        循环可变数组
        类型参数:
        T - 泛型
        参数:
        action - 循环消费对象
        args - 参数
        返回:
        true success, false fail
      • forSimpleArgs

        public static <T> boolean forSimpleArgs​(ForUtils.ConsumerSimple<T> action,
                                                boolean checkLength,
                                                T... args)
        循环可变数组
             基础类型需要传入包装类型, 如 int 传入为 Integer 为泛型类型
         
        类型参数:
        T - 泛型
        参数:
        action - 循环消费对象
        checkLength - 是否检查长度
        args - 参数
        返回:
        true success, false fail
      • forInts

        public static boolean forInts​(ForUtils.IntConsumer action,
                                      int... args)
        循环可变数组
        参数:
        action - 循环消费对象
        args - 参数
        返回:
        true success, false fail
      • forInts

        public static boolean forInts​(ForUtils.IntConsumer action,
                                      boolean checkLength,
                                      int... args)
        循环可变数组
        参数:
        action - 循环消费对象
        checkLength - 是否检查长度
        args - 参数
        返回:
        true success, false fail
      • forDoubles

        public static boolean forDoubles​(ForUtils.DoubleConsumer action,
                                         double... args)
        循环可变数组
        参数:
        action - 循环消费对象
        args - 参数
        返回:
        true success, false fail
      • forDoubles

        public static boolean forDoubles​(ForUtils.DoubleConsumer action,
                                         boolean checkLength,
                                         double... args)
        循环可变数组
        参数:
        action - 循环消费对象
        checkLength - 是否检查长度
        args - 参数
        返回:
        true success, false fail
      • forFloats

        public static boolean forFloats​(ForUtils.FloatConsumer action,
                                        float... args)
        循环可变数组
        参数:
        action - 循环消费对象
        args - 参数
        返回:
        true success, false fail
      • forFloats

        public static boolean forFloats​(ForUtils.FloatConsumer action,
                                        boolean checkLength,
                                        float... args)
        循环可变数组
        参数:
        action - 循环消费对象
        checkLength - 是否检查长度
        args - 参数
        返回:
        true success, false fail
      • forLongs

        public static boolean forLongs​(ForUtils.LongConsumer action,
                                       long... args)
        循环可变数组
        参数:
        action - 循环消费对象
        args - 参数
        返回:
        true success, false fail
      • forLongs

        public static boolean forLongs​(ForUtils.LongConsumer action,
                                       boolean checkLength,
                                       long... args)
        循环可变数组
        参数:
        action - 循环消费对象
        checkLength - 是否检查长度
        args - 参数
        返回:
        true success, false fail
      • forBooleans

        public static boolean forBooleans​(ForUtils.BooleanConsumer action,
                                          boolean... args)
        循环可变数组
        参数:
        action - 循环消费对象
        args - 参数
        返回:
        true success, false fail
      • forBooleans

        public static boolean forBooleans​(ForUtils.BooleanConsumer action,
                                          boolean checkLength,
                                          boolean... args)
        循环可变数组
        参数:
        action - 循环消费对象
        checkLength - 是否检查长度
        args - 参数
        返回:
        true success, false fail
      • forBytes

        public static boolean forBytes​(ForUtils.ByteConsumer action,
                                       byte... args)
        循环可变数组
        参数:
        action - 循环消费对象
        args - 参数
        返回:
        true success, false fail
      • forBytes

        public static boolean forBytes​(ForUtils.ByteConsumer action,
                                       boolean checkLength,
                                       byte... args)
        循环可变数组
        参数:
        action - 循环消费对象
        checkLength - 是否检查长度
        args - 参数
        返回:
        true success, false fail
      • forChars

        public static boolean forChars​(ForUtils.CharConsumer action,
                                       char... args)
        循环可变数组
        参数:
        action - 循环消费对象
        args - 参数
        返回:
        true success, false fail
      • forChars

        public static boolean forChars​(ForUtils.CharConsumer action,
                                       boolean checkLength,
                                       char... args)
        循环可变数组
        参数:
        action - 循环消费对象
        checkLength - 是否检查长度
        args - 参数
        返回:
        true success, false fail
      • forShorts

        public static boolean forShorts​(ForUtils.ShortConsumer action,
                                        short... args)
        循环可变数组
        参数:
        action - 循环消费对象
        args - 参数
        返回:
        true success, false fail
      • forShorts

        public static boolean forShorts​(ForUtils.ShortConsumer action,
                                        boolean checkLength,
                                        short... args)
        循环可变数组
        参数:
        action - 循环消费对象
        checkLength - 是否检查长度
        args - 参数
        返回:
        true success, false fail