Module io.leangen.geantyref
Package io.leangen.geantyref
Class AnnotatedTypeSet<E extends java.lang.reflect.AnnotatedType>
- java.lang.Object
-
- io.leangen.geantyref.AnnotatedTypeSet<E>
-
- Type Parameters:
E
- the type of the elements maintained by this set
- All Implemented Interfaces:
java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.Set<E>
public class AnnotatedTypeSet<E extends java.lang.reflect.AnnotatedType> extends java.lang.Object implements java.util.Set<E>
ASet
implementation suited for maintainingAnnotatedType
elements. The standard sets do not usually suffice asAnnotatedType
implements neitherequals
norhashCode
. This implementation overcomes that limitation by transparently turning eachAnnotatedType
into the canonical form usingGenericTypeReflector.toCanonical(AnnotatedType)
. By default,AnnotatedTypeSet
instances are backed by aHashSet
, but any set can be used instead. The guarantees ofAnnotatedTypeSet
are then the same as of the set it is backed by.- See Also:
AnnotatedTypeMap
-
-
Constructor Summary
Constructors Constructor Description AnnotatedTypeSet()
AnnotatedTypeSet(java.util.Set<E> inner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(E e)
boolean
addAll(java.util.Collection<? extends E> c)
private java.util.Collection<?>
canonical(java.util.Collection<?> c)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
boolean
isEmpty()
java.util.Iterator<E>
iterator()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
int
size()
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
-
-
-
Field Detail
-
inner
private final java.util.Set<E extends java.lang.reflect.AnnotatedType> inner
-
-
Constructor Detail
-
AnnotatedTypeSet
public AnnotatedTypeSet()
-
AnnotatedTypeSet
public AnnotatedTypeSet(java.util.Set<E> inner)
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(java.lang.Object o)
-
iterator
public java.util.Iterator<E> iterator()
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
add
public boolean add(E e)
-
remove
public boolean remove(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
addAll
public boolean addAll(java.util.Collection<? extends E> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
clear
public void clear()
-
canonical
private java.util.Collection<?> canonical(java.util.Collection<?> c)
-
-