Class Sets

java.lang.Object
io.keikai.doc.collab.lib0.Sets

public class Sets extends Object
Set Utility
  • Method Details

    • create

      public static <T> Set<T> create()
      Creates a new HashSet instance.
      Returns:
      A new HashSet instance.
    • toList

      public static <T> List<T> toList(Set<T> set)
      Converts a Set into a List.
      Type Parameters:
      T - The type of elements in the Set.
      Parameters:
      set - The Set to convert.
      Returns:
      A List containing all elements in the Set.
    • toArray

      public static <T> T[] toArray(Set<T> set)
      Converts a Set into a List.
      Type Parameters:
      T - The type of elements in the Set.
      Parameters:
      set - The Set to convert.
      Returns:
      A List containing all elements in the Set.
    • first

      public static <T> T first(Set<T> set)
      Returns the first element in the Set, or null if the Set is empty.
      Type Parameters:
      T - The type of elements in the Set.
      Parameters:
      set - The Set to retrieve the first element from.
      Returns:
      The first element in the Set, or null if the Set is empty.
    • from

      public static <T> Set<T> from(Iterable<T> entries)
      Creates a Set from an Iterable.
      Type Parameters:
      T - The type of elements in the Iterable.
      Parameters:
      entries - The Iterable of entries to add to the Set.
      Returns:
      A Set containing all elements in the Iterable.