Enum TypeDefinition.Sort
- All Implemented Interfaces:
Serializable, Comparable<TypeDefinition.Sort>, java.lang.constant.Constable
- Enclosing interface:
TypeDefinition
Represents a
TypeDescription.Generic's form.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceA proxy for interacting withjava.lang.reflect.AnnotatedType.Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRepresents a generic array type.Represents a non-generic type.Represents a parameterized type.Represents a type variable that is attached to aTypeVariableSource.Represents a type variable that is merely symbolic and is not attached to aTypeVariableSourceand does not defined bounds.Represents a wildcard type. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final TypeDefinition.Sort.AnnotatedTypeA dispatcher for interacting withjava.lang.reflect.AnnotatedType. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TypeDescription.GenericDescribes a loaded generic type as aTypeDescription.Generic.protected static TypeDescription.Genericdescribe(Type type, TypeDescription.Generic.AnnotationReader annotationReader) Describes the generic type while using the supplied annotation reader for resolving type annotations if this language feature is available on the current JVM.static TypeDescription.GenericdescribeAnnotated(AnnotatedElement annotatedType) Describes a loadedjava.lang.reflect.AnnotatedTypeas aTypeDescription.Generic.protected static TypeDescription.GenericdescribeOrNull(Type type, TypeDescription.Generic.AnnotationReader annotationReader) Describes the generic type while using the supplied annotation reader for resolving type annotations if this language feature is available on the current JVM.private static <T> TdoPrivileged(PrivilegedAction<T> action) A proxy forjava.security.AccessController#doPrivilegedthat is activated if available.booleanChecks if this type sort represents a generic array.booleanChecks if this type sort represents a non-generic type.booleanChecks if this type sort represents a parameterized type.booleanChecks if this type sort represents a type variable of any form.booleanChecks if this type sort represents a wildcard.static TypeDefinition.SortReturns the enum constant of this type with the specified name.static TypeDefinition.Sort[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
NON_GENERIC
Represents a non-generic type. -
GENERIC_ARRAY
Represents a generic array type. -
PARAMETERIZED
Represents a parameterized type. -
WILDCARD
Represents a wildcard type. -
VARIABLE
Represents a type variable that is attached to aTypeVariableSource. -
VARIABLE_SYMBOLIC
Represents a type variable that is merely symbolic and is not attached to aTypeVariableSourceand does not defined bounds.
-
-
Field Details
-
ANNOTATED_TYPE
A dispatcher for interacting withjava.lang.reflect.AnnotatedType.
-
-
Constructor Details
-
Sort
private Sort()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
doPrivileged
A proxy forjava.security.AccessController#doPrivilegedthat is activated if available.- Type Parameters:
T- The type of the action's resolved value.- Parameters:
action- The action to execute from a privileged context.- Returns:
- The action's resolved value.
-
describe
Describes a loaded generic type as aTypeDescription.Generic.- Parameters:
type- The type to describe.- Returns:
- A description of the provided generic type.
-
describeAnnotated
Describes a loadedjava.lang.reflect.AnnotatedTypeas aTypeDescription.Generic.- Parameters:
annotatedType- Thejava.lang.reflect.AnnotatedTypeto describe.- Returns:
- A description of the provided generic type.
-
describe
protected static TypeDescription.Generic describe(Type type, TypeDescription.Generic.AnnotationReader annotationReader) Describes the generic type while using the supplied annotation reader for resolving type annotations if this language feature is available on the current JVM.- Parameters:
type- The type to describe.annotationReader- The annotation reader for extracting type annotations.- Returns:
- A description of the provided generic annotated type.
-
describeOrNull
protected static TypeDescription.Generic describeOrNull(@MaybeNull Type type, TypeDescription.Generic.AnnotationReader annotationReader) Describes the generic type while using the supplied annotation reader for resolving type annotations if this language feature is available on the current JVM. This method applies a check for null values as malformed signatures might cause incorrectly formatted results. This might also be caused by obfuscation tools.- Parameters:
type- The type to describe.annotationReader- The annotation reader for extracting type annotations.- Returns:
- A description of the provided generic annotated type.
-
isNonGeneric
public boolean isNonGeneric()Checks if this type sort represents a non-generic type.- Returns:
trueif this sort form represents a non-generic.
-
isParameterized
public boolean isParameterized()Checks if this type sort represents a parameterized type.- Returns:
trueif this sort form represents a parameterized type.
-
isGenericArray
public boolean isGenericArray()Checks if this type sort represents a generic array.- Returns:
trueif this type sort represents a generic array.
-
isWildcard
public boolean isWildcard()Checks if this type sort represents a wildcard.- Returns:
trueif this type sort represents a wildcard.
-
isTypeVariable
public boolean isTypeVariable()Checks if this type sort represents a type variable of any form.- Returns:
trueif this type sort represents an attached type variable.
-