Package net.bytebuddy.implementation
Enum InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper
- java.lang.Object
-
- java.lang.Enum<InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper>
-
- net.bytebuddy.implementation.InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper>
- Enclosing interface:
- InvokeDynamic.InvocationProvider.ArgumentProvider
public static enum InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper extends java.lang.Enum<InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper>
Represents wrapper types and types that could be stored in a class's constant pool as such constant pool values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper.WrappingArgumentProvider
An argument provider that loads a primitive value from the constant pool and wraps it.
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLEAN
Stores aBoolean
as aboolean
and wraps it on load.BYTE
Stores aByte
as abyte
and wraps it on load.CHARACTER
Stores aCharacter
as achar
and wraps it on load.DOUBLE
Stores aDouble
as adouble
and wraps it on load.FLOAT
Stores aFloat
as afloat
and wraps it on load.INTEGER
Stores aInteger
as aint
and wraps it on load.LONG
Stores aLong
as along
and wraps it on load.SHORT
Stores aShort
as ashort
and wraps it on load.
-
Field Summary
Fields Modifier and Type Field Description private TypeDescription
primitiveType
The primitive type that can be stored on the constant pool.private TypeDescription
wrapperType
The wrapper type that is to be represented.
-
Constructor Summary
Constructors Modifier Constructor Description private
ConstantPoolWrapper(java.lang.Class<?> primitiveType, java.lang.Class<?> wrapperType)
Creates a new wrapper delegate for a primitive type.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract InvokeDynamic.InvocationProvider.ArgumentProvider
make(java.lang.Object value)
Creates an argument provider for a given primitive value.static InvokeDynamic.InvocationProvider.ArgumentProvider
of(java.lang.Object value)
Represents the given value by a constant pool value or as a field if this is not possible.static InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BOOLEAN
public static final InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper BOOLEAN
Stores aBoolean
as aboolean
and wraps it on load.
-
BYTE
public static final InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper BYTE
Stores aByte
as abyte
and wraps it on load.
-
SHORT
public static final InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper SHORT
Stores aShort
as ashort
and wraps it on load.
-
CHARACTER
public static final InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper CHARACTER
Stores aCharacter
as achar
and wraps it on load.
-
INTEGER
public static final InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper INTEGER
Stores aInteger
as aint
and wraps it on load.
-
LONG
public static final InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper LONG
Stores aLong
as along
and wraps it on load.
-
FLOAT
public static final InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper FLOAT
Stores aFloat
as afloat
and wraps it on load.
-
DOUBLE
public static final InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper DOUBLE
Stores aDouble
as adouble
and wraps it on load.
-
-
Field Detail
-
primitiveType
private final TypeDescription primitiveType
The primitive type that can be stored on the constant pool.
-
wrapperType
private final TypeDescription wrapperType
The wrapper type that is to be represented.
-
-
Constructor Detail
-
ConstantPoolWrapper
private ConstantPoolWrapper(java.lang.Class<?> primitiveType, java.lang.Class<?> wrapperType)
Creates a new wrapper delegate for a primitive type.- Parameters:
primitiveType
- The primitive type that can be stored on the constant pool.wrapperType
- The wrapper type that is to be represented.
-
-
Method Detail
-
values
public static InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper[] 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 (InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper c : InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper 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 InvokeDynamic.InvocationProvider.ArgumentProvider of(java.lang.Object value)
Represents the given value by a constant pool value or as a field if this is not possible.- Parameters:
value
- The value to provide to the bootstrapped method.- Returns:
- An argument provider for this value.
-
make
protected abstract InvokeDynamic.InvocationProvider.ArgumentProvider make(java.lang.Object value)
Creates an argument provider for a given primitive value.- Parameters:
value
- The wrapper-type value to provide to the bootstrapped method.- Returns:
- An argument provider for this value.
-
-