Class AnnotatedTypeSet<E extends AnnotatedType>
java.lang.Object
io.leangen.geantyref.AnnotatedTypeSet<E>
- Type Parameters:
E- the type of the elements maintained by this set
- All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>
A
Set implementation suited for maintaining AnnotatedType elements.
The standard sets do not usually suffice as AnnotatedType implements neither equals nor hashCode.
This implementation overcomes that limitation by transparently turning each AnnotatedType
into the canonical form using GenericTypeReflector.toCanonical(AnnotatedType).
By default, AnnotatedTypeSet instances are backed by a HashSet, but any set can be used instead.
The guarantees of AnnotatedTypeSet are then the same as of the set it is backed by.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends E> c) private Collection<?> canonical(Collection<?> c) voidclear()booleanbooleancontainsAll(Collection<?> c) booleanisEmpty()iterator()booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()Object[]toArray()<T> T[]toArray(T[] a) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface Set
equals, hashCode, spliterator
-
Field Details
-
inner
-
-
Constructor Details
-
AnnotatedTypeSet
public AnnotatedTypeSet() -
AnnotatedTypeSet
-
-
Method Details
-
size
public int size()- Specified by:
sizein interfaceCollection<E extends AnnotatedType>- Specified by:
sizein interfaceSet<E extends AnnotatedType>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<E extends AnnotatedType>- Specified by:
isEmptyin interfaceSet<E extends AnnotatedType>
-
contains
- Specified by:
containsin interfaceCollection<E extends AnnotatedType>- Specified by:
containsin interfaceSet<E extends AnnotatedType>
-
iterator
- Specified by:
iteratorin interfaceCollection<E extends AnnotatedType>- Specified by:
iteratorin interfaceIterable<E extends AnnotatedType>- Specified by:
iteratorin interfaceSet<E extends AnnotatedType>
-
toArray
- Specified by:
toArrayin interfaceCollection<E extends AnnotatedType>- Specified by:
toArrayin interfaceSet<E extends AnnotatedType>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<E extends AnnotatedType>- Specified by:
toArrayin interfaceSet<E extends AnnotatedType>
-
add
- Specified by:
addin interfaceCollection<E extends AnnotatedType>- Specified by:
addin interfaceSet<E extends AnnotatedType>
-
remove
- Specified by:
removein interfaceCollection<E extends AnnotatedType>- Specified by:
removein interfaceSet<E extends AnnotatedType>
-
containsAll
- Specified by:
containsAllin interfaceCollection<E extends AnnotatedType>- Specified by:
containsAllin interfaceSet<E extends AnnotatedType>
-
addAll
- Specified by:
addAllin interfaceCollection<E extends AnnotatedType>- Specified by:
addAllin interfaceSet<E extends AnnotatedType>
-
retainAll
- Specified by:
retainAllin interfaceCollection<E extends AnnotatedType>- Specified by:
retainAllin interfaceSet<E extends AnnotatedType>
-
removeAll
- Specified by:
removeAllin interfaceCollection<E extends AnnotatedType>- Specified by:
removeAllin interfaceSet<E extends AnnotatedType>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E extends AnnotatedType>- Specified by:
clearin interfaceSet<E extends AnnotatedType>
-
canonical
-