Package eu.bandm.tools.util.nonnull
Class SetProxy<E2>
java.lang.Object
eu.bandm.tools.util.nonnull.SetProxy<E2>
- Type Parameters:
E2- the type of the set elements
- All Implemented Interfaces:
Nullfree,NonNullSet<E2>,Iterable<E2>,Collection<E2>,Set<E2>
Internal proxy which inserts the checks for non-null into
all state-changing methods. Not directly accessible by the user.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends E2> c) asSorted()Returns a sorted, unmodifiable view if the backing peer is a sorted set.voidclear()booleanbooleancontainsAll(Collection<?> c) booleaninthashCode()booleanisEmpty()iterator()booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()Object[]toArray()<T1> T1[]toArray(T1[] a) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
spliterator
-
Field Details
-
peer
The object from JDK runtime which makes the real work.
-
-
Constructor Details
-
SetProxy
Not directly accessible by the user.- Parameters:
peer- The object from JDK runtime which makes the real work.- Throws:
NullPointerException- if the argument is null.
-
-
Method Details
-
asSorted
Returns a sorted, unmodifiable view if the backing peer is a sorted set.- Specified by:
asSortedin interfaceNonNullSet<E2>- Returns:
- a sorted, unmodifiable view if the backing peer is a sorted set.
- Throws:
UnsupportedOperationException- if the backing peer does not offer a sorted view.
-
add
-
addAll
-
clear
public void clear() -
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<E2>- Specified by:
containsAllin interfaceSet<E2>
-
equals
-
hashCode
public int hashCode() -
isEmpty
public boolean isEmpty() -
iterator
-
remove
-
removeAll
-
retainAll
-
size
public int size() -
toArray
-
toArray
public <T1> T1[] toArray(T1[] a)
-