Class DirtySet<E>

java.lang.Object
org.forgerock.http.util.SetDecorator<E>
org.forgerock.openig.session.jwt.dirty.DirtySet<E>
Type Parameters:
E - type of the set
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>

public class DirtySet<E> extends SetDecorator<E>
A Set decorator that notifies the provided DirtyListener when one ore more elements are removed.
  • Constructor Details

    • DirtySet

      public DirtySet(Set<E> set, DirtyListener listener)
      Constructs a new set decorator, wrapping the specified set.
      Parameters:
      set - the set to wrap with the decorator.
      listener - the change observer
  • Method Details

    • iterator

      public Iterator<E> iterator()
      Specified by:
      iterator in interface Collection<E>
      Specified by:
      iterator in interface Iterable<E>
      Specified by:
      iterator in interface Set<E>
      Overrides:
      iterator in class SetDecorator<E>
    • remove

      public boolean remove(Object o)
      Description copied from class: SetDecorator
      Removes the specified element from the set if it is present (optional operation).
      Specified by:
      remove in interface Collection<E>
      Specified by:
      remove in interface Set<E>
      Overrides:
      remove in class SetDecorator<E>
      Parameters:
      o - object to be removed from the set, if present.
      Returns:
      true if the set contained the specified element.
    • removeAll

      public boolean removeAll(Collection<?> c)
      Description copied from class: SetDecorator
      Removes from the set all of its elements that are contained in the specified collection (optional operation).
      Specified by:
      removeAll in interface Collection<E>
      Specified by:
      removeAll in interface Set<E>
      Overrides:
      removeAll in class SetDecorator<E>
      Parameters:
      c - collection containing elements to be removed from the set.
      Returns:
      true if the set changed as a result of the call.
    • retainAll

      public boolean retainAll(Collection<?> c)
      Description copied from class: SetDecorator
      Retains only the elements in the set that are contained in the specified collection (optional operation).
      Specified by:
      retainAll in interface Collection<E>
      Specified by:
      retainAll in interface Set<E>
      Overrides:
      retainAll in class SetDecorator<E>
      Parameters:
      c - collection containing elements to be retained in the set.
      Returns:
      true if the set changed as a result of the call.
    • clear

      public void clear()
      Description copied from class: SetDecorator
      Removes all of the elements from the set (optional operation).
      Specified by:
      clear in interface Collection<E>
      Specified by:
      clear in interface Set<E>
      Overrides:
      clear in class SetDecorator<E>