Package org.apache.commons.collections4.set

# Class AbstractSetDecorator<E>

java.lang.Object
org.apache.commons.collections4.collection.AbstractCollectionDecorator<E>
org.apache.commons.collections4.set.AbstractSetDecorator<E>

Type Parameters:
  `E` - the type of the elements in this set

All Implemented Interfaces:
  `Serializable`, `Iterable<E>`, `Collection<E>`, `Set<E>`

Direct Known Subclasses:
  `AbstractSerializableSetDecorator`, `AbstractSortedSetDecorator`, `UnmodifiableEntrySet`

public abstract class AbstractSetDecorator<E> extends AbstractCollectionDecorator<E> implements Set<E>
Decorates another `Set` to provide additional behavior.

Methods are forwarded directly to the decorated set.

Since:
  3.0
See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `AbstractSetDecorator()`
  Constructor only used in deserialization, do not use otherwise.
  `protected`
  `AbstractSetDecorator(Set<E> set)`
  Constructor that wraps (not copies).

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected Set<E>`
  `decorated()`
  Gets the set being decorated.
  `boolean`
  `equals(Object object)`
  `int`
  `hashCode()`

  ### Methods inherited from class org.apache.commons.collections4.collection.AbstractCollectionDecorator

  `add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, removeIf, retainAll, setCollection, size, toArray, toArray, toString`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface java.util.Collection

  `parallelStream, removeIf, stream`

  ### Methods inherited from interface java.lang.Iterable

  `forEach`

  ### Methods inherited from interface java.util.Set

  `add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArray`

- ## Constructor Details

  - ### AbstractSetDecorator

    protected AbstractSetDecorator()
    Constructor only used in deserialization, do not use otherwise.
    Since:
      3.1

  - ### AbstractSetDecorator

    protected AbstractSetDecorator(Set<E> set)
    Constructor that wraps (not copies).
    Parameters:
      `set` - the set to decorate, must not be null
    Throws:
      `NullPointerException` - if set is null

- ## Method Details

  - ### decorated

    protected Set<E> decorated()
    Gets the set being decorated.
    Overrides:
      `decorated` in class `AbstractCollectionDecorator<E>`
    Returns:
      the decorated set

  - ### equals

    public boolean equals(Object object)
    Specified by:
      `equals` in interface `Collection<E>`
    Specified by:
      `equals` in interface `Set<E>`
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Specified by:
      `hashCode` in interface `Collection<E>`
    Specified by:
      `hashCode` in interface `Set<E>`
    Overrides:
      `hashCode` in class `Object`