Package oracle.dbtools.plugin.api.types
Interface TypeQualifier<T>
- Type Parameters:
T- The type of the service
public interface TypeQualifier<T>
Qualifies the specific type of a service to be discovered via
InstanceLocator. Note that whilst JSR-330 supports the notion of
arbitrary Qualifiers, this framework only supports the use of the
Named qualifier.- Since:
- 19.3.0
- Author:
- cdivilly
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuildTypeQualifierinstancesstatic enumDetermines how theTypeQualifiermatches types -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TypeQualifier<T>Matches anyTypeQualifierof the specified type, ignoring anyQualifiers on the typeProvides the source code for thisTypeQualifierbooleanstatic <T> TypeQualifier<T>from(Class<T> type, Annotation... qualifiers) Deprecated.static <T> TypeQualifier<T>from(Class<T> type, Iterable<? extends Annotation> qualifiers) Deprecated.usenamed(Class, String),any(Class)orprovides(Class)to more accurately identify theTypeQualifierinthashCode()booleanisEmpty()Returns true if the qualifier has no annotation qualifiers, false otherwisebooleanmatches(TypeQualifier<?> other) Determines if thisTypeQualifieris a match for the specifiedTypeQualifierbooleanmatches(TypeReflection<?> type) Determines if thisTypeQualifieris a match for the specified typeIndicates how types are matchedname()Returns the name constraint of thisTypeQualifierif any.static <T> TypeQualifier<T>Construct aTypeQualifierfor the specified type and namedefault TypeQualifier<?>Normalize a potentially primitive type (e.g int.class) to it's boxed equivalent (e.g.static <T> TypeQualifier<T>Represents a provider of the specified servicetoString()type()The type of the instance to findstatic <T> TypeQualifier<T>Selects the specified concrete type<E> TypeQualifier<E>Override thisTypeQualifierto produce a new instance that uses the specified type
-
Method Details
-
declaration
String declaration()Provides the source code for thisTypeQualifier- Returns:
- Text representing how this qualifier would be instantiated in source code
-
equals
-
hashCode
int hashCode() -
isEmpty
boolean isEmpty()Returns true if the qualifier has no annotation qualifiers, false otherwise- Returns:
- true if the qualifier only denotes a type, i.e. has zero
Qualifierannotations, false otherwise
-
matches
Determines if thisTypeQualifieris a match for the specifiedTypeQualifier- Parameters:
other- The qualifier to test against- Returns:
- true if there is a match, false otherwise
-
matches
Determines if thisTypeQualifieris a match for the specified type- Parameters:
type- The type to test again- Returns:
- true if the qualifier matches, false otherwise
-
matchingMode
TypeQualifier.MatchingMode matchingMode()Indicates how types are matched- Returns:
TypeQualifier.MatchingModeinstance
-
name
String name()Returns the name constraint of thisTypeQualifierif any.- Returns:
- Name constraint, or null if this qualifier does not have a
Namedconstraint
-
withType
Override thisTypeQualifierto produce a new instance that uses the specified type- Type Parameters:
E- The overidden type of the qualifier- Parameters:
type- The new type- Returns:
TypeQualifierinstance
-
toString
String toString() -
type
The type of the instance to find- Returns:
- The type to find
-
any
Matches anyTypeQualifierof the specified type, ignoring anyQualifiers on the type- Type Parameters:
T- The type of the service- Parameters:
type- The type of the service- Returns:
TypeQualifierinstance
-
from
Deprecated.usenamed(Class, String),any(Class)orprovides(Class)to more accurately identify theTypeQualifierConstruct anTypeQualifierfrom the specifiedAnnotations. Note only theNamedqualifier annotation is considered. ArbitraryQualifierannotations are not supported as it is not possible to optimize their use for compile time dependency injection- Type Parameters:
T- The type of the service- Parameters:
type- The Type of the servicequalifiers- The set of annotations to examine- Returns:
TypeQualifierinstance
-
from
@Deprecated static <T> TypeQualifier<T> from(Class<T> type, Iterable<? extends Annotation> qualifiers) Deprecated.usenamed(Class, String),any(Class)orprovides(Class)to more accurately identify theTypeQualifierConstruct anTypeQualifierfrom the specifiedAnnotations. Note only theNamedqualifier annotation is considered. ArbitraryQualifierannotations are not supported as it is not possible to optimize their use for compile time dependency injection- Type Parameters:
T- The type of the service- Parameters:
type- The Type of the servicequalifiers- The set of annotations to examine- Returns:
TypeQualifierinstance
-
named
Construct aTypeQualifierfor the specified type and name- Type Parameters:
T- The type of the service- Parameters:
type- The type of the servicename- TheNamedqualifier bound to the service- Returns:
TypeQualifierinstance
-
provides
Represents a provider of the specified service- Type Parameters:
T- The type of the service- Parameters:
type- The type of the service- Returns:
TypeQualifierinstance
-
type
Selects the specified concrete type- Type Parameters:
T- The type of the service- Parameters:
type- The exact type to select- Returns:
TypeQualifierinstance
-
normalize
Normalize a potentially primitive type (e.g int.class) to it's boxed equivalent (e.g. Integer.class).- Returns:
- Self, unless this qualifier uses a primitive type, it's boxed equivalent
-
named(Class, String),any(Class)orprovides(Class)to more accurately identify theTypeQualifier