Interface QualifierKind
- All Superinterfaces:
Comparable<QualifierKind>
- All Known Implementing Classes:
DefaultQualifierKindHierarchy.DefaultQualifierKind
@AnnotatedFor("nullness")
@Interned
public interface QualifierKind
extends Comparable<QualifierKind>
Represents a kind of qualifier, which is an annotation class. If two qualifiers use the same
annotation class, then they have the same qualifier kind. Two qualifiers can have the same "kind"
of qualifier but not be the same qualifier; an example is
@IndexFor("a")
and
@IndexFor("b")
.
A QualifierKind
holds information about the relationship between itself and other
QualifierKind
s.
Exactly one qualifier kind is created for each annotation class.
The set of all QualifierKinds for a checker is like an enum. One QualifierKind is like an enum constant in that they are immutable after initialization and only a finite number exist per type system.
-
Method Summary
Modifier and TypeMethodDescriptiondefault int
Class<? extends Annotation>
Returns the annotation class for this.Returns the bottom qualifier kind of the hierarchy to which this qualifier kind belongs.getName()
Returns the canonical name of the annotation class of this.Returns the polymorphic qualifier kind of the hierarchy to which this qualifier kind belongs, or null if one does not exist.Set<? extends QualifierKind>
All the qualifier kinds that are a strict super qualifier of this qualifier.getTop()
Returns the top qualifier kind of the hierarchy to which this qualifier kind belongs.boolean
Returns true if the annotation class this qualifier kind represents has annotation elements/arguments.boolean
isBottom()
Returns true if this is the bottom qualifier of its hierarchy.boolean
isInSameHierarchyAs
(QualifierKind other) Returns true if this andother
are in the same hierarchy.boolean
isPoly()
Returns true if this is polymorphic.boolean
isSubtypeOf
(QualifierKind superQualKind) Returns true if this qualifier kind is a subtype of or equal tosuperQualKind
.boolean
isTop()
Returns true if this is the top qualifier of its hierarchy.
-
Method Details
-
getName
@Interned @CanonicalName String getName()Returns the canonical name of the annotation class of this.- Returns:
- the canonical name of the annotation class of this
-
getAnnotationClass
Class<? extends Annotation> getAnnotationClass()Returns the annotation class for this.- Returns:
- the annotation class for this
-
getTop
QualifierKind getTop()Returns the top qualifier kind of the hierarchy to which this qualifier kind belongs.- Returns:
- the top qualifier kind of the hierarchy to which this qualifier kind belongs
-
isTop
boolean isTop()Returns true if this is the top qualifier of its hierarchy.- Returns:
- true if this is the top qualifier of its hierarchy
-
getBottom
QualifierKind getBottom()Returns the bottom qualifier kind of the hierarchy to which this qualifier kind belongs.- Returns:
- the bottom qualifier kind of the hierarchy to which this qualifier kind belongs
-
isBottom
boolean isBottom()Returns true if this is the bottom qualifier of its hierarchy.- Returns:
- true if this is the bottom qualifier of its hierarchy
-
getPolymorphic
@Nullable QualifierKind getPolymorphic()Returns the polymorphic qualifier kind of the hierarchy to which this qualifier kind belongs, or null if one does not exist.- Returns:
- the polymorphic qualifier kind of the hierarchy to which this qualifier kind belongs, or null if one does not exist
-
isPoly
Returns true if this is polymorphic.- Returns:
- true if this is polymorphic
-
hasElements
boolean hasElements()Returns true if the annotation class this qualifier kind represents has annotation elements/arguments.- Returns:
- true if the annotation class this qualifier kind represents has elements/arguments
-
getStrictSuperTypes
Set<? extends QualifierKind> getStrictSuperTypes()All the qualifier kinds that are a strict super qualifier of this qualifier. Does not include this qualifier kind itself.- Returns:
- all the qualifier kinds that are a strict super qualifier of this qualifier
-
isInSameHierarchyAs
Returns true if this andother
are in the same hierarchy.- Parameters:
other
- a qualifier kind- Returns:
- true if this and
other
are in the same hierarchy
-
isSubtypeOf
Returns true if this qualifier kind is a subtype of or equal tosuperQualKind
.- Parameters:
superQualKind
- other qualifier kind- Returns:
- true if this qualifier kind is a subtype of or equal to
superQualKind
-
compareTo
- Specified by:
compareTo
in interfaceComparable<QualifierKind>
-