程序包 dev.utils.common

类 ForUtils

java.lang.Object
dev.utils.common.ForUtils

public final class ForUtils extends 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
    • forList

      public static <T> boolean forList(ForUtils.Consumer<T> action, List<T> list)
      循环集合
      类型参数:
      T - 泛型
      参数:
      action - 循环消费对象
      list - 集合
      返回:
      true success, false fail
    • forList

      public static <T> boolean forList(ForUtils.Consumer<T> action, boolean checkLength, List<T> list)
      循环集合
      类型参数:
      T - 泛型
      参数:
      action - 循环消费对象
      checkLength - 是否检查长度
      list - 集合
      返回:
      true success, false fail
    • forListIterator

      public static <T> boolean forListIterator(ForUtils.ConsumerIterator<T> action, List<T> list)
      循环集合
      类型参数:
      T - 泛型
      参数:
      action - 循环消费对象
      list - 集合
      返回:
      true success, false fail
    • forListIterator

      public static <T> boolean forListIterator(ForUtils.ConsumerIterator<T> action, boolean checkLength, List<T> list)
      循环集合
      类型参数:
      T - 泛型
      参数:
      action - 循环消费对象
      checkLength - 是否检查长度
      list - 集合
      返回:
      true success, false fail
    • forSet

      public static <T> boolean forSet(ForUtils.ConsumerIterator<T> action, Set<T> sets)
      循环集合
      类型参数:
      T - 泛型
      参数:
      action - 循环消费对象
      sets - 集合
      返回:
      true success, false fail
    • forSet

      public static <T> boolean forSet(ForUtils.ConsumerIterator<T> action, boolean checkLength, Set<T> sets)
      循环集合
      类型参数:
      T - 泛型
      参数:
      action - 循环消费对象
      checkLength - 是否检查长度
      sets - 集合
      返回:
      true success, false fail
    • forMap

      public static <K, V> boolean forMap(ForUtils.ConsumerMap<K,V> action, Map<K,V> maps)
      循环集合
      类型参数:
      K - key
      V - value
      参数:
      action - 循环消费对象
      maps - 集合
      返回:
      true success, false fail
    • forMap

      public static <K, V> boolean forMap(ForUtils.ConsumerMap<K,V> action, boolean checkLength, Map<K,V> maps)
      循环集合
      类型参数:
      K - key
      V - value
      参数:
      action - 循环消费对象
      checkLength - 是否检查长度
      maps - 集合
      返回:
      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