Class CollKit

java.lang.Object
com.iohao.net.common.kit.CollKit

public final class CollKit extends Object
Collection manipulation utilities.
Author:
渔民小镇
date:
2022-01-14
  • Method Details

    • notEmpty

      public static boolean notEmpty(Collection<?> collection)
      Check whether the collection is not null and not empty.
      Parameters:
      collection - the collection to check
      Returns:
      true if the collection contains at least one element
    • isEmpty

      public static boolean isEmpty(Collection<?> collection)
      Check whether the collection is null or empty.
      Parameters:
      collection - the collection to check
      Returns:
      true if the collection is null or contains no elements
    • ofConcurrentSet

      public static <T> Set<T> ofConcurrentSet()
      Create a new concurrent Set backed by a ConcurrentHashMap.
      Type Parameters:
      T - the element type
      Returns:
      a new thread-safe set
    • ofConcurrentHashMap

      public static <K,V> Map<K,V> ofConcurrentHashMap()
      Create a new ConcurrentHashMap.
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
      a new thread-safe map