Interface Qualifier

All Superinterfaces:
Annotation, Comparable<Annotation>, Prototype.Api
All Known Implementing Classes:
Qualifier.BuilderBase.QualifierImpl

public interface Qualifier extends Prototype.Api, Annotation
Represents a qualifier annotation (a specific case of annotations, annotated with Service.Qualifier).
See Also:
  • Field Details

  • Method Details

    • builder

      static Qualifier.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static Qualifier.Builder builder(Qualifier instance)
      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static Qualifier create()
      Create a new instance with default values.
      Returns:
      a new instance
    • create

      static Qualifier create(Class<? extends Annotation> qualifierType)
      Creates a qualifier from an annotation.
      Parameters:
      qualifierType - the qualifier type
      Returns:
      qualifier
    • create

      static Qualifier create(Class<? extends Annotation> qualifierType, String value)
      Creates a qualifier with a value from an annotation.
      Parameters:
      qualifierType - the qualifier type
      value - the value property
      Returns:
      qualifier
    • create

      static Qualifier create(TypeName qualifierType)
      Creates a qualifier from an annotation.
      Parameters:
      qualifierType - the qualifier type
      Returns:
      qualifier
    • create

      static Qualifier create(TypeName qualifierType, String value)
      Creates a qualifier with a value from an annotation.
      Parameters:
      qualifierType - the qualifier type
      value - the value property
      Returns:
      qualifier
    • create

      static Qualifier create(Annotation annotation)
      Creates a qualifier from an annotation.
      Parameters:
      annotation - the qualifier annotation
      Returns:
      qualifier
    • createNamed

      static Qualifier createNamed(String name)
      Creates a Service.Named qualifier.
      Parameters:
      name - the name
      Returns:
      named qualifier
    • createNamed

      static Qualifier createNamed(Service.Named name)
      Creates a Service.Named qualifier.
      Parameters:
      name - the name
      Returns:
      named qualifier
    • createNamed

      static Qualifier createNamed(Service.NamedByType name)
      Creates a Service.Named qualifier.
      Parameters:
      name - the name
      Returns:
      named qualifier
    • createNamed

      static Qualifier createNamed(Class<?> className)
      Creates a Service.Named qualifier from a class name.
      Parameters:
      className - class whose name will be used
      Returns:
      named qualifier
    • typeName

      TypeName typeName()
      The type name, e.g., Objects -> "java.util.Objects".
      Returns:
      the annotation type name
    • values

      Map<String,Object> values()
      Get a key-value of all the annotation properties.
      Returns:
      key-value pairs of all the properties present
    • metaAnnotations

      List<Annotation> metaAnnotations()
      A list of inherited annotations (from the whole hierarchy).
      Returns:
      list of all annotations declared on the annotation type, or inherited from them
    • value

      default Optional<String> value()
      The value property.
      Returns:
      the string value of value property
    • getValue

      default Optional<String> getValue(String property)
      Get a value of an annotation property.
      Parameters:
      property - name of the annotation property
      Returns:
      string value of the property
    • objectValue

      default Optional<Object> objectValue()
      Value of the annotation as an object. The type can be either String, or any primitive type, or Annotation, or list of these.
      Returns:
      object value
    • objectValue

      default Optional<Object> objectValue(String property)
      Value of the annotation property as an object. The type can be either String, or any primitive type, or Annotation, or list of these.
      Parameters:
      property - name of the annotation property
      Returns:
      object value
    • stringValue

      default Optional<String> stringValue()
      Typed value of the property "value".
      Returns:
      value if present
    • stringValue

      default Optional<String> stringValue(String property)
      Typed value of a named property.
      Parameters:
      property - name of the annotation property
      Returns:
      value if present
    • stringValues

      default Optional<List<String>> stringValues()
      Typed value of the property "value" that is defined as an array. This will also work for a single values property.
      Returns:
      list of defined values if present
    • stringValues

      default Optional<List<String>> stringValues(String property)
      Typed values of a property that is defined as an array. This will also work for a single values property.
      Parameters:
      property - name of the annotation property
      Returns:
      list of defined values if present
    • intValue

      default Optional<Integer> intValue()
      Typed value of the property "value".
      Returns:
      value if present
    • intValue

      default Optional<Integer> intValue(String property)
      Typed value of a named property.
      Parameters:
      property - name of the annotation property
      Returns:
      value if present
    • intValues

      default Optional<List<Integer>> intValues()
      Typed value of the property "value" that is defined as an array. This will also work for a single values property.
      Returns:
      list of defined values if present
    • intValues

      default Optional<List<Integer>> intValues(String property)
      Typed values of a property that is defined as an array. This will also work for a single values property.
      Parameters:
      property - name of the annotation property
      Returns:
      list of defined values if present
    • longValue

      default Optional<Long> longValue()
      Typed value of the property "value".
      Returns:
      value if present
    • longValue

      default Optional<Long> longValue(String property)
      Typed value of a named property.
      Parameters:
      property - name of the annotation property
      Returns:
      value if present
    • longValues

      default Optional<List<Long>> longValues()
      Typed value of the property "value" that is defined as an array. This will also work for a single values property.
      Returns:
      list of defined values if present
    • longValues

      default Optional<List<Long>> longValues(String property)
      Typed values of a property that is defined as an array. This will also work for a single values property.
      Parameters:
      property - name of the annotation property
      Returns:
      list of defined values if present
    • booleanValue

      default Optional<Boolean> booleanValue()
      Typed value of the property "value".
      Returns:
      value if present
    • booleanValue

      default Optional<Boolean> booleanValue(String property)
      Typed value of a named property.
      Parameters:
      property - name of the annotation property
      Returns:
      value if present
    • booleanValues

      default Optional<List<Boolean>> booleanValues()
      Typed value of the property "value" that is defined as an array. This will also work for a single values property.
      Returns:
      list of defined values if present
    • booleanValues

      default Optional<List<Boolean>> booleanValues(String property)
      Typed values of a property that is defined as an array. This will also work for a single values property.
      Parameters:
      property - name of the annotation property
      Returns:
      list of defined values if present
    • byteValue

      default Optional<Byte> byteValue()
      Typed value of the property "value".
      Returns:
      value if present
    • byteValue

      default Optional<Byte> byteValue(String property)
      Typed value of a named property.
      Parameters:
      property - name of the annotation property
      Returns:
      value if present
    • byteValues

      default Optional<List<Byte>> byteValues()
      Typed value of the property "value" that is defined as an array. This will also work for a single values property.
      Returns:
      list of defined values if present
    • byteValues

      default Optional<List<Byte>> byteValues(String property)
      Typed values of a property that is defined as an array. This will also work for a single values property.
      Parameters:
      property - name of the annotation property
      Returns:
      list of defined values if present
    • charValue

      default Optional<Character> charValue()
      Typed value of the property "value".
      Returns:
      value if present
    • charValue

      default Optional<Character> charValue(String property)
      Typed value of a named property.
      Parameters:
      property - name of the annotation property
      Returns:
      value if present
    • charValues

      default Optional<List<Character>> charValues()
      Typed value of the property "value" that is defined as an array. This will also work for a single values property.
      Returns:
      list of defined values if present
    • charValues

      default Optional<List<Character>> charValues(String property)
      Typed values of a property that is defined as an array. This will also work for a single values property.
      Parameters:
      property - name of the annotation property
      Returns:
      list of defined values if present
    • shortValue

      default Optional<Short> shortValue()
      Typed value of the property "value".
      Returns:
      value if present
    • shortValue

      default Optional<Short> shortValue(String property)
      Typed value of a named property.
      Parameters:
      property - name of the annotation property
      Returns:
      value if present
    • shortValues

      default Optional<List<Short>> shortValues()
      Typed value of the property "value" that is defined as an array. This will also work for a single values property.
      Returns:
      list of defined values if present
    • shortValues

      default Optional<List<Short>> shortValues(String property)
      Typed values of a property that is defined as an array. This will also work for a single values property.
      Parameters:
      property - name of the annotation property
      Returns:
      list of defined values if present
    • floatValue

      default Optional<Float> floatValue()
      Typed value of the property "value".
      Returns:
      value if present
    • floatValue

      default Optional<Float> floatValue(String property)
      Typed value of a named property.
      Parameters:
      property - name of the annotation property
      Returns:
      value if present
    • floatValues

      default Optional<List<Float>> floatValues()
      Typed value of the property "value" that is defined as an array. This will also work for a single values property.
      Returns:
      list of defined values if present
    • floatValues

      default Optional<List<Float>> floatValues(String property)
      Typed values of a property that is defined as an array. This will also work for a single values property.
      Parameters:
      property - name of the annotation property
      Returns:
      list of defined values if present
    • doubleValue

      default Optional<Double> doubleValue()
      Typed value of the property "value".
      Returns:
      value if present
    • doubleValue

      default Optional<Double> doubleValue(String property)
      Typed value of a named property.
      Parameters:
      property - name of the annotation property
      Returns:
      value if present
    • doubleValues

      default Optional<List<Double>> doubleValues()
      Typed value of the property "value" that is defined as an array. This will also work for a single values property.
      Returns:
      list of defined values if present
    • doubleValues

      default Optional<List<Double>> doubleValues(String property)
      Typed values of a property that is defined as an array. This will also work for a single values property.
      Parameters:
      property - name of the annotation property
      Returns:
      list of defined values if present
    • classValue

      default Optional<Class<?>> classValue()
      Typed value of the property "value".
      Returns:
      value if present
    • classValue

      default Optional<Class<?>> classValue(String property)
      Typed value of a named property.
      Parameters:
      property - name of the annotation property
      Returns:
      value if present
    • classValues

      default Optional<List<Class<?>>> classValues()
      Typed value of the property "value" that is defined as an array. This will also work for a single values property.
      Returns:
      list of defined values if present
    • classValues

      default Optional<List<Class<?>>> classValues(String property)
      Typed values of a property that is defined as an array. This will also work for a single values property.
      Parameters:
      property - name of the annotation property
      Returns:
      list of defined values if present
    • typeValue

      default Optional<TypeName> typeValue()
      Typed value of the property "value". Alternative for classValue().
      Returns:
      value if present
    • typeValue

      default Optional<TypeName> typeValue(String property)
      Typed value of a named property. Alternative for classValue(String).
      Parameters:
      property - name of the annotation property
      Returns:
      value if present
    • typeValues

      default Optional<List<TypeName>> typeValues()
      Typed value of the property "value" that is defined as an array. This will also work for a single values property. Alternative for classValues().
      Returns:
      list of defined values if present
    • typeValues

      default Optional<List<TypeName>> typeValues(String property)
      Typed values of a property that is defined as an array. This will also work for a single values property. Alternative for classValues(String).
      Parameters:
      property - name of the annotation property
      Returns:
      list of defined values if present
    • annotationValue

      default Optional<Annotation> annotationValue()
      Typed value of the property "value".
      Returns:
      value if present
    • annotationValue

      default Optional<Annotation> annotationValue(String property)
      Typed value of a named property.
      Parameters:
      property - name of the annotation property
      Returns:
      value if present
    • annotationValues

      default Optional<List<Annotation>> annotationValues()
      Typed value of the property "value" that is defined as an array. This will also work for a single values property.
      Returns:
      list of defined values if present
    • annotationValues

      default Optional<List<Annotation>> annotationValues(String property)
      Typed values of a property that is defined as an array. This will also work for a single values property.
      Parameters:
      property - name of the annotation property
      Returns:
      list of defined values if present
    • enumValue

      default <T extends Enum<T>> Optional<T> enumValue(Class<T> type)
      Typed value of the property "value".
      Type Parameters:
      T - type of the enumeration
      Parameters:
      type - class of the enumeration
      Returns:
      value if present
    • enumValue

      default <T extends Enum<T>> Optional<T> enumValue(String property, Class<T> type)
      Typed value of a named property.
      Type Parameters:
      T - type of the enumeration
      Parameters:
      property - name of the annotation property
      type - class of the enumeration
      Returns:
      value if present
    • enumValues

      default <T extends Enum<T>> Optional<List<T>> enumValues(Class<T> type)
      Typed value of the property "value" that is defined as an array. This will also work for a single values property.
      Type Parameters:
      T - type of the enumeration
      Parameters:
      type - class of the enumeration
      Returns:
      list of defined values if present
    • enumValues

      default <T extends Enum<T>> Optional<List<T>> enumValues(String property, Class<T> type)
      Typed values of a property that is defined as an array. This will also work for a single values property.
      Type Parameters:
      T - type of the enumeration
      Parameters:
      property - name of the annotation property
      type - class of the enumeration
      Returns:
      list of defined values if present
    • hasMetaAnnotation

      default boolean hasMetaAnnotation(TypeName annotationType)
      Check if AnnotationBlueprint.metaAnnotations() contains an annotation of the provided type.

      Note: we ignore Target, Inherited, Documented, and Retention.

      Parameters:
      annotationType - type of annotation
      Returns:
      true if the annotation is declared on this annotation, or is inherited from a declared annotation