Module io.leangen.geantyref
Package io.leangen.geantyref
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 TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends E> c) private Collection
<?> canonical
(Collection<?> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
equals, hashCode, spliterator
-
Field Details
-
inner
-
-
Constructor Details
-
AnnotatedTypeSet
public AnnotatedTypeSet() -
AnnotatedTypeSet
-
-
Method Details
-
size
public int size()- Specified by:
size
in interfaceCollection<E extends AnnotatedType>
- Specified by:
size
in interfaceSet<E extends AnnotatedType>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<E extends AnnotatedType>
- Specified by:
isEmpty
in interfaceSet<E extends AnnotatedType>
-
contains
- Specified by:
contains
in interfaceCollection<E extends AnnotatedType>
- Specified by:
contains
in interfaceSet<E extends AnnotatedType>
-
iterator
- Specified by:
iterator
in interfaceCollection<E extends AnnotatedType>
- Specified by:
iterator
in interfaceIterable<E extends AnnotatedType>
- Specified by:
iterator
in interfaceSet<E extends AnnotatedType>
-
toArray
- Specified by:
toArray
in interfaceCollection<E extends AnnotatedType>
- Specified by:
toArray
in interfaceSet<E extends AnnotatedType>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArray
in interfaceCollection<E extends AnnotatedType>
- Specified by:
toArray
in interfaceSet<E extends AnnotatedType>
-
add
- Specified by:
add
in interfaceCollection<E extends AnnotatedType>
- Specified by:
add
in interfaceSet<E extends AnnotatedType>
-
remove
- Specified by:
remove
in interfaceCollection<E extends AnnotatedType>
- Specified by:
remove
in interfaceSet<E extends AnnotatedType>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E extends AnnotatedType>
- Specified by:
containsAll
in interfaceSet<E extends AnnotatedType>
-
addAll
- Specified by:
addAll
in interfaceCollection<E extends AnnotatedType>
- Specified by:
addAll
in interfaceSet<E extends AnnotatedType>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<E extends AnnotatedType>
- Specified by:
retainAll
in interfaceSet<E extends AnnotatedType>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<E extends AnnotatedType>
- Specified by:
removeAll
in interfaceSet<E extends AnnotatedType>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<E extends AnnotatedType>
- Specified by:
clear
in interfaceSet<E extends AnnotatedType>
-
canonical
-