java.lang.Object
io.github.mmm.value.observable.container.set.ChangeAwareSets

public final class ChangeAwareSets extends Object
Factory for ChangeAwareSet.
Since:
1.0.0
  • Method Details

    • empty

      public static <E> ChangeAwareSet<E> empty()
      Type Parameters:
      E - the type of the elements.
      Returns:
      an empty, immutable ChangeAwareSet.
    • of

      public static <E> ChangeAwareSet<E> of()
      Type Parameters:
      E - the type of the elements.
      Returns:
      a new empty mutable ChangeAwareSet.
    • of

      public static <E> ChangeAwareSet<E> of(int capacity)
      Type Parameters:
      E - the type of the elements.
      Parameters:
      capacity - the initial capacity of the set.
      Returns:
      a new empty mutable ChangeAwareSet.
    • of

      public static <E> ChangeAwareSet<E> of(Set<E> set)
      Type Parameters:
      E - the type of the elements.
      Parameters:
      set - the existing Set implementation to wrap as ChangeAwareSet. Please avoid to modify this Set afterwards, as this will not trigger modification events.
      Returns:
      a new empty mutable ChangeAwareSet.
    • ofUnmodifiable

      public static <E> ChangeAwareSet<E> ofUnmodifiable(Set<E> set)
      Type Parameters:
      E - the type of the elements.
      Parameters:
      set - the existing List implementation to wrap as ChangeAwareList. Modifying such List afterwards will not trigger modification events in the read-only view returned by this method.
      Returns:
      an unmodifiable ChangeAwareList that acts as a view on the given Set.
    • ofUnmodifiable

      public static <E> ChangeAwareSet<E> ofUnmodifiable(Supplier<Set<E>> setSupplier)
      Type Parameters:
      E - the type of the elements.
      Parameters:
      setSupplier - the existing List implementation to wrap as ChangeAwareList. Modifying such List afterwards will not trigger modification events in the read-only view returned by this method.
      Returns:
      an unmodifiable ChangeAwareList that acts as a view on the supplied Set.