Package net.bytebuddy.description.type
Enum TypeDefinition.Sort
- java.lang.Object
-
- java.lang.Enum<TypeDefinition.Sort>
-
- net.bytebuddy.description.type.TypeDefinition.Sort
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<TypeDefinition.Sort>
- Enclosing interface:
- TypeDefinition
public static enum TypeDefinition.Sort extends java.lang.Enum<TypeDefinition.Sort>
Represents aTypeDescription.Generic
's form.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description GENERIC_ARRAY
Represents a generic array type.NON_GENERIC
Represents a non-generic type.PARAMETERIZED
Represents a parameterized 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 aTypeVariableSource
and does not defined bounds.WILDCARD
Represents a wildcard type.
-
Constructor Summary
Constructors Modifier Constructor Description private
Sort()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TypeDescription.Generic
describe(java.lang.reflect.Type type)
Describes a loaded generic type as aTypeDescription.Generic
.protected static TypeDescription.Generic
describe(java.lang.reflect.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.boolean
isGenericArray()
Checks if this type sort represents a generic array.boolean
isNonGeneric()
Checks if this type sort represents a non-generic type.boolean
isParameterized()
Checks if this type sort represents a parameterized type.boolean
isTypeVariable()
Checks if this type sort represents a type variable of any form.boolean
isWildcard()
Checks if this type sort represents a wildcard.static TypeDefinition.Sort
valueOf(java.lang.String name)
Returns 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 Detail
-
NON_GENERIC
public static final TypeDefinition.Sort NON_GENERIC
Represents a non-generic type.
-
GENERIC_ARRAY
public static final TypeDefinition.Sort GENERIC_ARRAY
Represents a generic array type.
-
PARAMETERIZED
public static final TypeDefinition.Sort PARAMETERIZED
Represents a parameterized type.
-
WILDCARD
public static final TypeDefinition.Sort WILDCARD
Represents a wildcard type.
-
VARIABLE
public static final TypeDefinition.Sort VARIABLE
Represents a type variable that is attached to aTypeVariableSource
.
-
VARIABLE_SYMBOLIC
public static final TypeDefinition.Sort VARIABLE_SYMBOLIC
Represents a type variable that is merely symbolic and is not attached to aTypeVariableSource
and does not defined bounds.
-
-
Method Detail
-
values
public static TypeDefinition.Sort[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TypeDefinition.Sort c : TypeDefinition.Sort.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TypeDefinition.Sort valueOf(java.lang.String name)
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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
describe
public static TypeDescription.Generic describe(java.lang.reflect.Type type)
Describes a loaded generic type as aTypeDescription.Generic
.- Parameters:
type
- The type to describe.- Returns:
- A description of the provided generic type.
-
describe
protected static TypeDescription.Generic describe(java.lang.reflect.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.
-
isNonGeneric
public boolean isNonGeneric()
Checks if this type sort represents a non-generic type.- Returns:
true
if this sort form represents a non-generic.
-
isParameterized
public boolean isParameterized()
Checks if this type sort represents a parameterized type.- Returns:
true
if this sort form represents a parameterized type.
-
isGenericArray
public boolean isGenericArray()
Checks if this type sort represents a generic array.- Returns:
true
if this type sort represents a generic array.
-
isWildcard
public boolean isWildcard()
Checks if this type sort represents a wildcard.- Returns:
true
if this type sort represents a wildcard.
-
isTypeVariable
public boolean isTypeVariable()
Checks if this type sort represents a type variable of any form.- Returns:
true
if this type sort represents an attached type variable.
-
-