Package org.jdbi.v3.core.qualifier
Class QualifiedType<T>
java.lang.Object
org.jdbi.v3.core.qualifier.QualifiedType<T>
- Type Parameters:
T
- the type that is qualified
A
Type
qualified by a set of qualifier annotations. Two qualified types are equal to each other
if their getType()
and getQualifiers()
properties are equal.-
Method Summary
Modifier and TypeMethodDescriptionboolean
flatMapType(Function<Type,Optional<Type>> mapper)
Apply the provided mapping function to the type, and if non-empty is returned, return anOptional<QualifiedType<?>>
with the returned type, and the same qualifiers as this instance.getType()
int
hashCode()
boolean
hasQualifier(Class<? extends Annotation> qualifier)
Apply the provided mapping function to the type, and if non-empty is returned, return anOptional<QualifiedType<?>>
with the returned type, and the same qualifiers as this instance.static <T> QualifiedType<T>
Creates aQualifiedType<T>
for aClass<T>
with no qualifiers.static QualifiedType<?>
Creates a wildcardQualifiedType<?>
for aType
with no qualifiers.static <T> QualifiedType<T>
of(GenericType<T> type)
Creates aQualifiedType<T>
for aGenericType<T>
with no qualifiers.toString()
with(Annotation... newQualifiers)
Returns a QualifiedType that has the same type as this instance, but with only the given qualifiers.with(Class<? extends Annotation>... newQualifiers)
Returns a QualifiedType that has the same type as this instance, but with only the given qualifiers.withAnnotationClasses(Iterable<Class<? extends Annotation>> newQualifiers)
withAnnotations(Iterable<? extends Annotation> newQualifiers)
-
Method Details
-
of
Creates aQualifiedType<T>
for aClass<T>
with no qualifiers.- Parameters:
clazz
- the unqualified type- Returns:
- the unqualified QualifiedType
- See Also:
to then qualify your type
-
of
Creates a wildcardQualifiedType<?>
for aType
with no qualifiers.- Parameters:
type
- the unqualified type- Returns:
- the unqualified QualifiedType
- See Also:
to then qualify your type
-
of
Creates aQualifiedType<T>
for aGenericType<T>
with no qualifiers.- Parameters:
type
- the unqualified type- Returns:
- the unqualified QualifiedType
- See Also:
to then qualify your type
-
with
Returns a QualifiedType that has the same type as this instance, but with only the given qualifiers.- Parameters:
newQualifiers
- the qualifiers for the new qualified type.- Returns:
- the QualifiedType
-
with
Returns a QualifiedType that has the same type as this instance, but with only the given qualifiers.- Parameters:
newQualifiers
- the qualifiers for the new qualified type.- Returns:
- the QualifiedType
- Throws:
IllegalArgumentException
- if any of the given qualifier types have annotation attributes.
-
withAnnotations
- Parameters:
newQualifiers
- the qualifiers for the new qualified type.- Returns:
- a QualifiedType that has the same type as this instance, but with only the given qualifiers.
-
withAnnotationClasses
- Parameters:
newQualifiers
- the qualifiers for the new qualified type.- Returns:
- a QualifiedType that has the same type as this instance, but with only the given qualifiers.
-
getType
- Returns:
- the type being qualified
-
getQualifiers
- Returns:
- the type qualifiers.
-
mapType
Apply the provided mapping function to the type, and if non-empty is returned, return anOptional<QualifiedType<?>>
with the returned type, and the same qualifiers as this instance.- Parameters:
mapper
- a mapping function to apply to the type- Returns:
- an optional qualified type with the mapped type and the same qualifiers
-
flatMapType
Apply the provided mapping function to the type, and if non-empty is returned, return anOptional<QualifiedType<?>>
with the returned type, and the same qualifiers as this instance.- Parameters:
mapper
- a mapping function to apply to the type- Returns:
- an optional qualified type with the mapped type and the same qualifiers
-
hasQualifier
- Parameters:
qualifier
- qualifier to check for- Returns:
- true if this instance contains the given qualifier
-
equals
-
hashCode
public int hashCode() -
toString
-