T - the type that is qualified@Beta public final class QualifiedType<T> extends Object
Type qualified by a set of qualifier annotations. Two qualified types are equal to each other
if their getType() and getQualifiers() properties are equal.| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
Optional<QualifiedType<?>> |
flatMapType(Function<Type,Optional<Type>> mapper)
Apply the provided mapping function to the type, and if non-empty is returned,
return an
Optional<QualifiedType<?>> with the returned type, and the same
qualifiers as this instance. |
Set<Annotation> |
getQualifiers() |
Type |
getType() |
int |
hashCode() |
boolean |
hasQualifier(Class<? extends Annotation> qualifier) |
QualifiedType<?> |
mapType(Function<Type,Type> mapper)
Apply the provided mapping function to the type, and if non-empty is returned,
return an
Optional<QualifiedType<?>> with the returned type, and the same
qualifiers as this instance. |
static <T> QualifiedType<T> |
of(Class<T> clazz)
Creates a
QualifiedType<T> for a Class<T> with no qualifiers. |
static <T> QualifiedType<T> |
of(GenericType<T> type)
Creates a
QualifiedType<T> for a GenericType<T> with no qualifiers. |
static QualifiedType<?> |
of(Type type)
Creates a wildcard
QualifiedType<?> for a Type with no qualifiers. |
String |
toString() |
QualifiedType<T> |
with(Annotation... qualifiers)
Returns a QualifiedType that has the same type as this instance, but with only the given qualifiers.
|
QualifiedType<T> |
with(Class<? extends Annotation>... qualifiers)
Returns a QualifiedType that has the same type as this instance, but with only the given qualifiers.
|
QualifiedType<T> |
withAnnotationClasses(Iterable<Class<? extends Annotation>> qualifiers) |
QualifiedType<T> |
withAnnotations(Iterable<? extends Annotation> qualifiers) |
public Optional<QualifiedType<?>> flatMapType(Function<Type,Optional<Type>> mapper)
Optional<QualifiedType<?>> with the returned type, and the same
qualifiers as this instance.mapper - a mapping function to apply to the typepublic Set<Annotation> getQualifiers()
public Type getType()
public boolean hasQualifier(Class<? extends Annotation> qualifier)
qualifier - qualifier to check forpublic QualifiedType<?> mapType(Function<Type,Type> mapper)
Optional<QualifiedType<?>> with the returned type, and the same
qualifiers as this instance.mapper - a mapping function to apply to the typepublic static <T> QualifiedType<T> of(Class<T> clazz)
QualifiedType<T> for a Class<T> with no qualifiers.clazz - the unqualified typeto then qualify your typepublic static <T> QualifiedType<T> of(GenericType<T> type)
QualifiedType<T> for a GenericType<T> with no qualifiers.type - the unqualified typeto then qualify your typepublic static QualifiedType<?> of(Type type)
QualifiedType<?> for a Type with no qualifiers.type - the unqualified typeto then qualify your typepublic QualifiedType<T> with(Annotation... qualifiers)
qualifiers - the qualifiers for the new qualified type.@SafeVarargs public final QualifiedType<T> with(Class<? extends Annotation>... qualifiers)
qualifiers - the qualifiers for the new qualified type.IllegalArgumentException - if any of the given qualifier types have annotation attributes.public QualifiedType<T> withAnnotationClasses(Iterable<Class<? extends Annotation>> qualifiers)
qualifiers - the qualifiers for the new qualified type.public QualifiedType<T> withAnnotations(Iterable<? extends Annotation> qualifiers)
qualifiers - the qualifiers for the new qualified type.Copyright © 2019. All rights reserved.