Top Description Inners Methods
net.bytebuddy.utility

public Interface ConstantValue

Known Direct Subinterfaces
net.bytebuddy.utility.JavaConstant
Known Direct Implementers
net.bytebuddy.utility.ConstantValue.Simple
Imports
net.bytebuddy.build.HashCodeAndEqualsPlugin, net.bytebuddy.description.enumeration.EnumerationDescription, net.bytebuddy.description.type.TypeDescription, net.bytebuddy.implementation.bytecode.StackManipulation, net.bytebuddy.implementation.bytecode.constant.ClassConstant, .IntegerConstant, net.bytebuddy.implementation.bytecode.member.FieldAccess, net.bytebuddy.utility.nullability.MaybeNull

Represents a value that can be represented as a constant expression or constant pool value.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
ConstantValue.Simple

A simple representation of a constant value.

Method Summary

Modifier and TypeMethod and Description
public TypeDescription

Returns:

A description of the type of this constant.
getTypeDescription
()

Returns a description of the type of this constant.

public StackManipulation

Returns:

A stack manipulation loading this value.
toStackManipulation
()

Returns a stack manipulation loading this value.

Method Detail

getTypeDescriptionback to summary
public TypeDescription getTypeDescription()

Returns a description of the type of this constant.

Returns:TypeDescription

A description of the type of this constant.

toStackManipulationback to summary
public StackManipulation toStackManipulation()

Returns a stack manipulation loading this value.

Returns:StackManipulation

A stack manipulation loading this value.

net.bytebuddy.utility back to summary

public Class ConstantValue.Simple

extends Object
implements ConstantValue
Class Inheritance
All Implemented Interfaces
net.bytebuddy.utility.ConstantValue
Annotations
@Enhance

A simple representation of a constant value.

Field Summary

Modifier and TypeField and Description
private final StackManipulation
stackManipulation

A stack manipulation that loads a constant.

private final TypeDescription
typeDescription

The description of the constant value's type.

Constructor Summary

AccessConstructor and Description
protected
Simple(StackManipulation
A stack manipulation that loads a constant.
stackManipulation
,
TypeDescription
The description of the constant value's type.
typeDescription
)

Creates a simple constant value.

Method Summary

Modifier and TypeMethod and Description
public TypeDescription
getTypeDescription()

Implements net.bytebuddy.utility.ConstantValue.getTypeDescription.

Returns a description of the type of this constant.
public StackManipulation
toStackManipulation()

Implements net.bytebuddy.utility.ConstantValue.toStackManipulation.

Returns a stack manipulation loading this value.
public static ConstantValue

Returns:

An appropriate representation of the constant value.
wrap
(Object
The value to represent as a constant.
value
)

Returns a constant value for the supplied constant value.

public static ConstantValue

Returns:

An appropriate representation of the constant value or null if the supplied value is not representable as a compile-time constant.
wrapOrNull
(Object
The value to represent as a constant.
value
)

Returns a constant value for the supplied constant value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

stackManipulationback to summary
private final StackManipulation stackManipulation

A stack manipulation that loads a constant.

typeDescriptionback to summary
private final TypeDescription typeDescription

The description of the constant value's type.

Constructor Detail

Simpleback to summary
protected Simple(StackManipulation stackManipulation, TypeDescription typeDescription)

Creates a simple constant value.

Parameters
stackManipulation:StackManipulation

A stack manipulation that loads a constant.

typeDescription:TypeDescription

The description of the constant value's type.

Method Detail

getTypeDescriptionback to summary
public TypeDescription getTypeDescription()

Implements net.bytebuddy.utility.ConstantValue.getTypeDescription.

Doc from net.bytebuddy.utility.ConstantValue.getTypeDescription.

Returns a description of the type of this constant.

Returns:TypeDescription

A description of the type of this constant.

toStackManipulationback to summary
public StackManipulation toStackManipulation()

Implements net.bytebuddy.utility.ConstantValue.toStackManipulation.

Doc from net.bytebuddy.utility.ConstantValue.toStackManipulation.

Returns a stack manipulation loading this value.

Returns:StackManipulation

A stack manipulation loading this value.

wrapback to summary
public static ConstantValue wrap(Object value)

Returns a constant value for the supplied constant value.

Parameters
value:Object

The value to represent as a constant.

Returns:ConstantValue

An appropriate representation of the constant value.

wrapOrNullback to summary
public static ConstantValue wrapOrNull(Object value)

Returns a constant value for the supplied constant value.

Parameters
value:Object

The value to represent as a constant.

Returns:ConstantValue

An appropriate representation of the constant value or null if the supplied value is not representable as a compile-time constant.

Annotations
@MaybeNull