Class KiwiSets


  • public class KiwiSets
    extends Object
    Utility methods for working with Set instances.
    • Constructor Detail

      • KiwiSets

        public KiwiSets()
    • Method Detail

      • isNullOrEmpty

        public static <T> boolean isNullOrEmpty​(Set<T> set)
        Checks whether the specified set is null or empty.
        Type Parameters:
        T - the type of items in the set
        Parameters:
        set - the set
        Returns:
        true if set is null or empty; false otherwise
      • isNotNullOrEmpty

        public static <T> boolean isNotNullOrEmpty​(Set<T> set)
        Checks whether the specified is neither null nor empty.
        Type Parameters:
        T - the type of items in the set
        Parameters:
        set - the set
        Returns:
        true if set is neither null nor empty; false otherwise
      • hasOneElement

        public static <T> boolean hasOneElement​(Set<T> set)
        Checks whether the specified list is non-null and has only one item.
        Type Parameters:
        T - the type of items in the set
        Parameters:
        set - the set
        Returns:
        true if list is non-null and has exactly one item; false