Package net.bytebuddy.pool
Enum TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType
- java.lang.Object
-
- java.lang.Enum<TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType>
-
- net.bytebuddy.pool.TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType>
,TypePool.Default.LazyTypeDescription.GenericTypeToken
- Enclosing interface:
- TypePool.Default.LazyTypeDescription.GenericTypeToken
public static enum TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType extends java.lang.Enum<TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType> implements TypePool.Default.LazyTypeDescription.GenericTypeToken
A generic type token that represents a primitive type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType.LazyPrimitiveType
A representation of a lazy primitive type.-
Nested classes/interfaces inherited from interface net.bytebuddy.pool.TypePool.Default.LazyTypeDescription.GenericTypeToken
TypePool.Default.LazyTypeDescription.GenericTypeToken.ForGenericArray, TypePool.Default.LazyTypeDescription.GenericTypeToken.ForLowerBoundWildcard, TypePool.Default.LazyTypeDescription.GenericTypeToken.ForParameterizedType, TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType, TypePool.Default.LazyTypeDescription.GenericTypeToken.ForRawType, TypePool.Default.LazyTypeDescription.GenericTypeToken.ForTypeVariable, TypePool.Default.LazyTypeDescription.GenericTypeToken.ForUnboundWildcard, TypePool.Default.LazyTypeDescription.GenericTypeToken.ForUpperBoundWildcard, TypePool.Default.LazyTypeDescription.GenericTypeToken.LazyTokenList, TypePool.Default.LazyTypeDescription.GenericTypeToken.OfFormalTypeVariable, TypePool.Default.LazyTypeDescription.GenericTypeToken.Resolution
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLEAN
The generic type token describing theboolean
type.BYTE
The generic type token describing thebyte
type.CHAR
The generic type token describing thechar
type.DOUBLE
The generic type token describing thedouble
type.FLOAT
The generic type token describing thefloat
type.INTEGER
The generic type token describing theint
type.LONG
The generic type token describing thelong
type.SHORT
The generic type token describing theshort
type.VOID
The generic type token describing thevoid
type.
-
Field Summary
Fields Modifier and Type Field Description private TypeDescription
typeDescription
A description of this primitive type token.-
Fields inherited from interface net.bytebuddy.pool.TypePool.Default.LazyTypeDescription.GenericTypeToken
COMPONENT_TYPE_PATH, EMPTY_TYPE_PATH, INDEXED_TYPE_DELIMITER, INNER_CLASS_PATH, WILDCARD_TYPE_PATH
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ForPrimitiveType(java.lang.Class<?> type)
Creates a new primitive type token.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getTypePathPrefix()
Returns the type path prefix that needs to be appended to the existing type path before any further navigation on the parameterized type.boolean
isPrimaryBound(TypePool typePool)
Determines if a generic type tokens represents a primary bound of a type variable.static TypePool.Default.LazyTypeDescription.GenericTypeToken
of(char descriptor)
Resolves a generic type token of a primitive type.TypeDescription.Generic
toGenericType(TypePool typePool, TypeVariableSource typeVariableSource, java.lang.String typePath, java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> annotationTokens)
Transforms this token into a generic type representation.static TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BOOLEAN
public static final TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType BOOLEAN
The generic type token describing theboolean
type.
-
BYTE
public static final TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType BYTE
The generic type token describing thebyte
type.
-
SHORT
public static final TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType SHORT
The generic type token describing theshort
type.
-
CHAR
public static final TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType CHAR
The generic type token describing thechar
type.
-
INTEGER
public static final TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType INTEGER
The generic type token describing theint
type.
-
LONG
public static final TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType LONG
The generic type token describing thelong
type.
-
FLOAT
public static final TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType FLOAT
The generic type token describing thefloat
type.
-
DOUBLE
public static final TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType DOUBLE
The generic type token describing thedouble
type.
-
VOID
public static final TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType VOID
The generic type token describing thevoid
type.
-
-
Field Detail
-
typeDescription
private final TypeDescription typeDescription
A description of this primitive type token.
-
-
Method Detail
-
values
public static TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType[] 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 (TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType c : TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TypePool.Default.LazyTypeDescription.GenericTypeToken.ForPrimitiveType 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
-
of
public static TypePool.Default.LazyTypeDescription.GenericTypeToken of(char descriptor)
Resolves a generic type token of a primitive type.- Parameters:
descriptor
- The descriptor of the primitive type.- Returns:
- The corresponding generic type token.
-
toGenericType
public TypeDescription.Generic toGenericType(TypePool typePool, TypeVariableSource typeVariableSource, java.lang.String typePath, java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> annotationTokens)
Transforms this token into a generic type representation.- Specified by:
toGenericType
in interfaceTypePool.Default.LazyTypeDescription.GenericTypeToken
- Parameters:
typePool
- The type pool to be used for locating non-generic type descriptions.typeVariableSource
- The type variable source.typePath
- The type path of the resolved generic type.annotationTokens
- A mapping of the type's annotation tokens by their type path.- Returns:
- A description of the represented generic type.
-
isPrimaryBound
public boolean isPrimaryBound(TypePool typePool)
Determines if a generic type tokens represents a primary bound of a type variable. This method must only be invoked on types that represent aTypeDefinition.Sort.NON_GENERIC
,TypeDefinition.Sort.PARAMETERIZED
orTypeDefinition.Sort.VARIABLE
.- Specified by:
isPrimaryBound
in interfaceTypePool.Default.LazyTypeDescription.GenericTypeToken
- Parameters:
typePool
- The type pool to use.- Returns:
true
if this token represents a primary bound.
-
getTypePathPrefix
public java.lang.String getTypePathPrefix()
Returns the type path prefix that needs to be appended to the existing type path before any further navigation on the parameterized type. This method must only be called on type tokens that represent parameterized type- Specified by:
getTypePathPrefix
in interfaceTypePool.Default.LazyTypeDescription.GenericTypeToken
- Returns:
- A type path segment that needs to be appended to the base type path before any further navigation on the parameterized type.
-
-