Class SetExtensions


  • public class SetExtensions
    extends java.lang.Object
    Extensions class for use with Set objects
    • Constructor Summary

      Constructors 
      Constructor Description
      SetExtensions()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T[] toArray​(@NonNull java.util.Set<T> set)
      Converts the given Set to an array
      static <T> java.util.Set<T> toSet​(java.util.Collection<T> collection)
      Converts the given Collection to a Set
      static <T> java.util.SortedSet<T> toSortedSet​(java.util.Collection<T> collection)
      Converts the given Collection to a SortedSet.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SetExtensions

        public SetExtensions()
    • Method Detail

      • toArray

        public static <T> T[] toArray​(@NonNull
                                      @NonNull java.util.Set<T> set)
        Converts the given Set to an array
        Type Parameters:
        T - the generic type
        Parameters:
        set - the set
        Returns:
        the array from the given Set
      • toSet

        public static <T> java.util.Set<T> toSet​(java.util.Collection<T> collection)
        Converts the given Collection to a Set
        Type Parameters:
        T - the generic type of the elements
        Parameters:
        collection - the collection
        Returns:
        A new Set
      • toSortedSet

        public static <T> java.util.SortedSet<T> toSortedSet​(java.util.Collection<T> collection)
        Converts the given Collection to a SortedSet.
        Type Parameters:
        T - the generic type of the elements
        Parameters:
        collection - the collection
        Returns:
        A new SortedSet