Package net.bytebuddy.implementation
Enum ToStringMethod.ValueConsumer
- java.lang.Object
-
- java.lang.Enum<ToStringMethod.ValueConsumer>
-
- net.bytebuddy.implementation.ToStringMethod.ValueConsumer
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ToStringMethod.ValueConsumer>
,StackManipulation
- Enclosing class:
- ToStringMethod
protected static enum ToStringMethod.ValueConsumer extends java.lang.Enum<ToStringMethod.ValueConsumer> implements StackManipulation
A value consumer that is responsible for adding a field value to the string creatingStringBuilder
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bytecode.StackManipulation
StackManipulation.Compound, StackManipulation.Illegal, StackManipulation.Size, StackManipulation.Trivial
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLEAN
A value consumer for aboolean
value.BOOLEAN_ARRAY
A value consumer for aboolean
array type.BYTE_ARRAY
A value consumer for abyte
array type.CHARACTER
A value consumer for achar
value.CHARACTER_ARRAY
A value consumer for achar
array type.CHARACTER_SEQUENCE
A value consumer for aCharSequence
value.DOUBLE
A value consumer for adouble
value.DOUBLE_ARRAY
A value consumer for adouble
array type.FLOAT
A value consumer for afloat
value.FLOAT_ARRAY
A value consumer for afloat
array type.INTEGER
A value consumer for anint
value.INTEGER_ARRAY
A value consumer for anint
array type.LONG
A value consumer for along
value.LONG_ARRAY
A value consumer for along
array type.NESTED_ARRAY
A value consumer for a nested array type.OBJECT
A value consumer for a reference type.REFERENCE_ARRAY
A value consumer for a reference array type.SHORT_ARRAY
A value consumer for ashort
array type.STRING
A value consumer for aString
value.
-
Constructor Summary
Constructors Modifier Constructor Description private
ValueConsumer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isValid()
Determines if this stack manipulation is valid.protected static StackManipulation
of(TypeDescription typeDescription)
Resolves an appropriate value resolver for a given type.static ToStringMethod.ValueConsumer
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ToStringMethod.ValueConsumer[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface net.bytebuddy.implementation.bytecode.StackManipulation
apply
-
-
-
-
Enum Constant Detail
-
BOOLEAN
public static final ToStringMethod.ValueConsumer BOOLEAN
A value consumer for aboolean
value.
-
CHARACTER
public static final ToStringMethod.ValueConsumer CHARACTER
A value consumer for achar
value.
-
INTEGER
public static final ToStringMethod.ValueConsumer INTEGER
A value consumer for anint
value.
-
LONG
public static final ToStringMethod.ValueConsumer LONG
A value consumer for along
value.
-
FLOAT
public static final ToStringMethod.ValueConsumer FLOAT
A value consumer for afloat
value.
-
DOUBLE
public static final ToStringMethod.ValueConsumer DOUBLE
A value consumer for adouble
value.
-
STRING
public static final ToStringMethod.ValueConsumer STRING
A value consumer for aString
value.
-
CHARACTER_SEQUENCE
public static final ToStringMethod.ValueConsumer CHARACTER_SEQUENCE
A value consumer for aCharSequence
value.
-
OBJECT
public static final ToStringMethod.ValueConsumer OBJECT
A value consumer for a reference type.
-
BOOLEAN_ARRAY
public static final ToStringMethod.ValueConsumer BOOLEAN_ARRAY
A value consumer for aboolean
array type.
-
BYTE_ARRAY
public static final ToStringMethod.ValueConsumer BYTE_ARRAY
A value consumer for abyte
array type.
-
SHORT_ARRAY
public static final ToStringMethod.ValueConsumer SHORT_ARRAY
A value consumer for ashort
array type.
-
CHARACTER_ARRAY
public static final ToStringMethod.ValueConsumer CHARACTER_ARRAY
A value consumer for achar
array type.
-
INTEGER_ARRAY
public static final ToStringMethod.ValueConsumer INTEGER_ARRAY
A value consumer for anint
array type.
-
LONG_ARRAY
public static final ToStringMethod.ValueConsumer LONG_ARRAY
A value consumer for along
array type.
-
FLOAT_ARRAY
public static final ToStringMethod.ValueConsumer FLOAT_ARRAY
A value consumer for afloat
array type.
-
DOUBLE_ARRAY
public static final ToStringMethod.ValueConsumer DOUBLE_ARRAY
A value consumer for adouble
array type.
-
REFERENCE_ARRAY
public static final ToStringMethod.ValueConsumer REFERENCE_ARRAY
A value consumer for a reference array type.
-
NESTED_ARRAY
public static final ToStringMethod.ValueConsumer NESTED_ARRAY
A value consumer for a nested array type.
-
-
Method Detail
-
values
public static ToStringMethod.ValueConsumer[] 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 (ToStringMethod.ValueConsumer c : ToStringMethod.ValueConsumer.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ToStringMethod.ValueConsumer 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
protected static StackManipulation of(TypeDescription typeDescription)
Resolves an appropriate value resolver for a given type.- Parameters:
typeDescription
- The type for which to resolve a value resolver.- Returns:
- An appropriate stack manipulation.
-
isValid
public boolean isValid()
Determines if this stack manipulation is valid.- Specified by:
isValid
in interfaceStackManipulation
- Returns:
- If
false
, this manipulation cannot be applied and should throw an exception.
-
-