Package org.jboss.resteasy.util.snapshot

## Class SnapshotSet<T>

- java.lang.Object
- - org.jboss.resteasy.util.snapshot.SnapshotSet<T>

- All Implemented Interfaces:
    `Iterable<T>`, `Collection<T>`, `Set<T>`

      public class SnapshotSet<T>
      extends Object
      implements Set<T>

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected Set<T>` | `delegate` |
    `protected boolean` | `lockSnapshots` |
    `protected boolean` | `snapFirst` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SnapshotSet​(boolean lockSnapshots)` |
    `SnapshotSet​(Set<T> set, boolean shallow, boolean lockSnapshots, boolean snapFirst)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `add​(T t)` |
    `boolean` | `addAll​(Collection<? extends T> collection)` |
    `void` | `clear()` |
    `boolean` | `contains​(Object o)` |
    `boolean` | `containsAll​(Collection<?> collection)` |
    `protected Set<T>` | `copy()` |
    `protected HashSet<T>` | `copy​(Set<T> set)` |
    `boolean` | `equals​(Object o)` |
    `void` | `forEach​(Consumer<? super T> action)` |
    `int` | `hashCode()` |
    `boolean` | `isEmpty()` |
    `Iterator<T>` | `iterator()` |
    `void` | `lockSnapshots()` |
    `Stream<T>` | `parallelStream()` |
    `boolean` | `remove​(Object o)` |
    `boolean` | `removeAll​(Collection<?> collection)` |
    `boolean` | `removeIf​(Predicate<? super T> filter)` |
    `boolean` | `retainAll​(Collection<?> collection)` |
    `int` | `size()` |
    `Spliterator<T>` | `spliterator()` |
    `Stream<T>` | `stream()` |
    `Object[]` | `toArray()` |
    `<T1> T1[]` | `toArray​(T1[] t1s)` |

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

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

- - ### Field Detail

    - #### delegate

          protected volatile Set<T> delegate

    - #### lockSnapshots

          protected volatile boolean lockSnapshots

    - #### snapFirst

          protected volatile boolean snapFirst

  - ### Constructor Detail

    - #### SnapshotSet

          public SnapshotSet​(boolean lockSnapshots)

    - #### SnapshotSet

          public SnapshotSet​(Set<T> set,
                             boolean shallow,
                             boolean lockSnapshots,
                             boolean snapFirst)

  - ### Method Detail

    - #### copy

          protected HashSet<T> copy​(Set<T> set)

    - #### lockSnapshots

          public void lockSnapshots()

    - #### copy

          protected Set<T> copy()

    - #### add

          public boolean add​(T t)

      Specified by:
        `add` in interface `Collection<T>`
      Specified by:
        `add` in interface `Set<T>`

    - #### remove

          public boolean remove​(Object o)

      Specified by:
        `remove` in interface `Collection<T>`
      Specified by:
        `remove` in interface `Set<T>`

    - #### addAll

          public boolean addAll​(Collection<? extends T> collection)

      Specified by:
        `addAll` in interface `Collection<T>`
      Specified by:
        `addAll` in interface `Set<T>`

    - #### retainAll

          public boolean retainAll​(Collection<?> collection)

      Specified by:
        `retainAll` in interface `Collection<T>`
      Specified by:
        `retainAll` in interface `Set<T>`

    - #### removeAll

          public boolean removeAll​(Collection<?> collection)

      Specified by:
        `removeAll` in interface `Collection<T>`
      Specified by:
        `removeAll` in interface `Set<T>`

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `Collection<T>`
      Specified by:
        `clear` in interface `Set<T>`

    - #### removeIf

          public boolean removeIf​(Predicate<? super T> filter)

      Specified by:
        `removeIf` in interface `Collection<T>`

    - #### size

          public int size()

      Specified by:
        `size` in interface `Collection<T>`
      Specified by:
        `size` in interface `Set<T>`

    - #### isEmpty

          public boolean isEmpty()

      Specified by:
        `isEmpty` in interface `Collection<T>`
      Specified by:
        `isEmpty` in interface `Set<T>`

    - #### contains

          public boolean contains​(Object o)

      Specified by:
        `contains` in interface `Collection<T>`
      Specified by:
        `contains` in interface `Set<T>`

    - #### iterator

          public Iterator<T> iterator()

      Specified by:
        `iterator` in interface `Collection<T>`
      Specified by:
        `iterator` in interface `Iterable<T>`
      Specified by:
        `iterator` in interface `Set<T>`

    - #### toArray

          public Object[] toArray()

      Specified by:
        `toArray` in interface `Collection<T>`
      Specified by:
        `toArray` in interface `Set<T>`

    - #### toArray

          public <T1> T1[] toArray​(T1[] t1s)

      Specified by:
        `toArray` in interface `Collection<T>`
      Specified by:
        `toArray` in interface `Set<T>`

    - #### containsAll

          public boolean containsAll​(Collection<?> collection)

      Specified by:
        `containsAll` in interface `Collection<T>`
      Specified by:
        `containsAll` in interface `Set<T>`

    - #### equals

          public boolean equals​(Object o)

      Specified by:
        `equals` in interface `Collection<T>`
      Specified by:
        `equals` in interface `Set<T>`
      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in interface `Collection<T>`
      Specified by:
        `hashCode` in interface `Set<T>`
      Overrides:
        `hashCode` in class `Object`

    - #### spliterator

          public Spliterator<T> spliterator()

      Specified by:
        `spliterator` in interface `Collection<T>`
      Specified by:
        `spliterator` in interface `Iterable<T>`
      Specified by:
        `spliterator` in interface `Set<T>`

    - #### stream

          public Stream<T> stream()

      Specified by:
        `stream` in interface `Collection<T>`

    - #### parallelStream

          public Stream<T> parallelStream()

      Specified by:
        `parallelStream` in interface `Collection<T>`

    - #### forEach

          public void forEach​(Consumer<? super T> action)

      Specified by:
        `forEach` in interface `Iterable<T>`