Interface QualifierKind
-
- All Superinterfaces:
java.lang.Comparable<QualifierKind>
- All Known Implementing Classes:
DefaultQualifierKindHierarchy.DefaultQualifierKind
@AnnotatedFor("nullness") @Interned public interface QualifierKind extends java.lang.Comparable<QualifierKind>
Represents a kind of qualifier, which is an annotation class. Does not represent annotation elements. 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 otherQualifierKind
s.Exactly one qualifier kind is created for each annotation class.
The set of all
QualifierKind
s for a checker is like an enum. OneQualifierKind
is like an enum constant in that they are immutable after initialization and only a finite number exist per type system.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default int
compareTo(QualifierKind o)
java.lang.Class<? extends java.lang.annotation.Annotation>
getAnnotationClass()
Returns the annotation class for this.QualifierKind
getBottom()
Returns the bottom qualifier kind of the hierarchy to which this qualifier kind belongs.@Interned @CanonicalName java.lang.String
getName()
Returns the canonical name of the annotation class of this.@Nullable QualifierKind
getPolymorphic()
Returns the polymorphic qualifier kind of the hierarchy to which this qualifier kind belongs, or null if one does not exist.java.util.Set<? extends QualifierKind>
getStrictSuperTypes()
All the qualifier kinds that are a strict super qualifier of this qualifier.QualifierKind
getTop()
Returns the top qualifier kind of the hierarchy to which this qualifier kind belongs.boolean
hasElements()
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 Detail
-
getName
@Interned @CanonicalName java.lang.String getName()
Returns the canonical name of the annotation class of this.- Returns:
- the canonical name of the annotation class of this
-
getAnnotationClass
java.lang.Class<? extends java.lang.annotation.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
@Pure boolean 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
java.util.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
boolean isInSameHierarchyAs(QualifierKind other)
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
boolean isSubtypeOf(QualifierKind superQualKind)
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
default int compareTo(QualifierKind o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<QualifierKind>
-
-