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. 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 other QualifierKinds.

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 Details

    • 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

      @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

      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 and other 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 to superQualKind.
      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 interface Comparable<QualifierKind>