Top Description Inners Fields Constructors Methods
net.bytebuddy.implementation.bytecode.assign.primitive

public final Enum PrimitiveWideningDelegate

extends Enum<PrimitiveWideningDelegate>
Class Inheritance
Imports
net.bytebuddy.build.HashCodeAndEqualsPlugin, net.bytebuddy.description.type.TypeDefinition, net.bytebuddy.implementation.Implementation, net.bytebuddy.implementation.bytecode.StackManipulation, .StackSize, net.bytebuddy.jar.asm.MethodVisitor, .Opcodes

This delegate is responsible for widening a primitive type to represent a larger primitive type. The rules for this widening are equivalent to those in the JLS.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
PrimitiveWideningDelegate.WideningStackManipulation

A stack manipulation that widens a primitive type into a more general primitive type.

Field Summary

Modifier and TypeField and Description
public static final PrimitiveWideningDelegate
BOOLEAN

The widening delegate for boolean values.

public static final PrimitiveWideningDelegate
BYTE

The widening delegate for byte values.

public static final PrimitiveWideningDelegate
CHARACTER

The widening delegate for char values.

public static final PrimitiveWideningDelegate
DOUBLE

The widening delegate for double values.

public static final PrimitiveWideningDelegate
FLOAT

The widening delegate for float values.

public static final PrimitiveWideningDelegate
INTEGER

The widening delegate for int values.

public static final PrimitiveWideningDelegate
LONG

The widening delegate for long values.

public static final PrimitiveWideningDelegate
SHORT

The widening delegate for short values.

private final StackManipulation
toBooleanStackManipulation

A stack manipulation that widens the type that is represented by this instance to a boolean.

private final StackManipulation
toByteStackManipulation

A stack manipulation that widens the type that is represented by this instance to a byte.

private final StackManipulation
toCharacterStackManipulation

A stack manipulation that widens the type that is represented by this instance to a char.

private final StackManipulation
toDoubleStackManipulation

A stack manipulation that widens the type that is represented by this instance to a double.

private final StackManipulation
toFloatStackManipulation

A stack manipulation that widens the type that is represented by this instance to a float.

private final StackManipulation
toIntegerStackManipulation

A stack manipulation that widens the type that is represented by this instance to a int.

private final StackManipulation
toLongStackManipulation

A stack manipulation that widens the type that is represented by this instance to a long.

private final StackManipulation
toShortStackManipulation

A stack manipulation that widens the type that is represented by this instance to a short.

Constructor Summary

AccessConstructor and Description
private
PrimitiveWideningDelegate(StackManipulation
A stack manipulation that widens the type that is represented by this instance to a boolean.
toBooleanStackManipulation
,
StackManipulation
A stack manipulation that widens the type that is represented by this instance to a byte.
toByteStackManipulation
,
StackManipulation
A stack manipulation that widens the type that is represented by this instance to a short.
toShortStackManipulation
,
StackManipulation
A stack manipulation that widens the type that is represented by this instance to a char.
toCharacterStackManipulation
,
StackManipulation
A stack manipulation that widens the type that is represented by this instance to a int.
toIntegerStackManipulation
,
StackManipulation
A stack manipulation that widens the type that is represented by this instance to a long.
toLongStackManipulation
,
StackManipulation
A stack manipulation that widens the type that is represented by this instance to a float.
toFloatStackManipulation
,
StackManipulation
A stack manipulation that widens the type that is represented by this instance to a double.
toDoubleStackManipulation
)

Creates a new primitive widening delegate.

Method Summary

Modifier and TypeMethod and Description
public static PrimitiveWideningDelegate

Returns:

A delegate for the given type.
forPrimitive
(TypeDefinition
A non-void primitive type that is to be widened into another type.
typeDefinition
)

Locates the delegate that is capable of widening the given type into another type.

public static PrimitiveWideningDelegate
public static PrimitiveWideningDelegate[]
public StackManipulation

Returns:

A widening instruction or an illegal stack manipulation if such widening is not legitimate.
widenTo
(TypeDefinition
A non-void primitive type that is the expected result of the widening operation.
typeDefinition
)

Attempts to widen the represented type into another type.

Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BOOLEANback to summary
public static final PrimitiveWideningDelegate BOOLEAN

The widening delegate for boolean values.

BYTEback to summary
public static final PrimitiveWideningDelegate BYTE

The widening delegate for byte values.

CHARACTERback to summary
public static final PrimitiveWideningDelegate CHARACTER

The widening delegate for char values.

DOUBLEback to summary
public static final PrimitiveWideningDelegate DOUBLE

The widening delegate for double values.

FLOATback to summary
public static final PrimitiveWideningDelegate FLOAT

The widening delegate for float values.

INTEGERback to summary
public static final PrimitiveWideningDelegate INTEGER

The widening delegate for int values.

LONGback to summary
public static final PrimitiveWideningDelegate LONG

The widening delegate for long values.

SHORTback to summary
public static final PrimitiveWideningDelegate SHORT

The widening delegate for short values.

toBooleanStackManipulationback to summary
private final StackManipulation toBooleanStackManipulation

A stack manipulation that widens the type that is represented by this instance to a boolean.

toByteStackManipulationback to summary
private final StackManipulation toByteStackManipulation

A stack manipulation that widens the type that is represented by this instance to a byte.

toCharacterStackManipulationback to summary
private final StackManipulation toCharacterStackManipulation

A stack manipulation that widens the type that is represented by this instance to a char.

toDoubleStackManipulationback to summary
private final StackManipulation toDoubleStackManipulation

A stack manipulation that widens the type that is represented by this instance to a double.

toFloatStackManipulationback to summary
private final StackManipulation toFloatStackManipulation

A stack manipulation that widens the type that is represented by this instance to a float.

toIntegerStackManipulationback to summary
private final StackManipulation toIntegerStackManipulation

A stack manipulation that widens the type that is represented by this instance to a int.

toLongStackManipulationback to summary
private final StackManipulation toLongStackManipulation

A stack manipulation that widens the type that is represented by this instance to a long.

toShortStackManipulationback to summary
private final StackManipulation toShortStackManipulation

A stack manipulation that widens the type that is represented by this instance to a short.

Constructor Detail

PrimitiveWideningDelegateback to summary
private PrimitiveWideningDelegate(StackManipulation toBooleanStackManipulation, StackManipulation toByteStackManipulation, StackManipulation toShortStackManipulation, StackManipulation toCharacterStackManipulation, StackManipulation toIntegerStackManipulation, StackManipulation toLongStackManipulation, StackManipulation toFloatStackManipulation, StackManipulation toDoubleStackManipulation)

Creates a new primitive widening delegate.

Parameters
toBooleanStackManipulation:StackManipulation

A stack manipulation that widens the type that is represented by this instance to a boolean.

toByteStackManipulation:StackManipulation

A stack manipulation that widens the type that is represented by this instance to a byte.

toShortStackManipulation:StackManipulation

A stack manipulation that widens the type that is represented by this instance to a short.

toCharacterStackManipulation:StackManipulation

A stack manipulation that widens the type that is represented by this instance to a char.

toIntegerStackManipulation:StackManipulation

A stack manipulation that widens the type that is represented by this instance to a int.

toLongStackManipulation:StackManipulation

A stack manipulation that widens the type that is represented by this instance to a long.

toFloatStackManipulation:StackManipulation

A stack manipulation that widens the type that is represented by this instance to a float.

toDoubleStackManipulation:StackManipulation

A stack manipulation that widens the type that is represented by this instance to a double.

Method Detail

forPrimitiveback to summary
public static PrimitiveWideningDelegate forPrimitive(TypeDefinition typeDefinition)

Locates the delegate that is capable of widening the given type into another type.

Parameters
typeDefinition:TypeDefinition

A non-void primitive type that is to be widened into another type.

Returns:PrimitiveWideningDelegate

A delegate for the given type.

valueOfback to summary
public static PrimitiveWideningDelegate valueOf(String name)
valuesback to summary
public static PrimitiveWideningDelegate[] values()
widenToback to summary
public StackManipulation widenTo(TypeDefinition typeDefinition)

Attempts to widen the represented type into another type.

Parameters
typeDefinition:TypeDefinition

A non-void primitive type that is the expected result of the widening operation.

Returns:StackManipulation

A widening instruction or an illegal stack manipulation if such widening is not legitimate.

net.bytebuddy.implementation.bytecode.assign.primitive back to summary

protected Class PrimitiveWideningDelegate.WideningStackManipulation

extends AbstractBase
Class Inheritance
Annotations
@Enhance

A stack manipulation that widens a primitive type into a more general primitive type.

Field Summary

Modifier and TypeField and Description
private final int
conversionOpcode

The opcode for executing the conversion.

private final StackManipulation.Size
size

The size change of applying the conversion.

Constructor Summary

AccessConstructor and Description
protected
WideningStackManipulation(int
The opcode for executing the conversion.
conversionOpcode
,
StackManipulation.Size
The size change of applying the conversion.
size
)

Creates a new widening stack manipulation.

Method Summary

Modifier and TypeMethod and Description
public StackManipulation.Size
apply(MethodVisitor
The method visitor used to write the method implementation to.
methodVisitor
,
Implementation.Context
The context of the current implementation.
implementationContext
)

Implements net.bytebuddy.implementation.bytecode.StackManipulation.apply.

Applies the stack manipulation that is described by this instance.
Inherited from net.bytebuddy.implementation.bytecode.StackManipulation.AbstractBase:
isValid

Field Detail

conversionOpcodeback to summary
private final int conversionOpcode

The opcode for executing the conversion.

sizeback to summary
private final StackManipulation.Size size

The size change of applying the conversion.

Constructor Detail

WideningStackManipulationback to summary
protected WideningStackManipulation(int conversionOpcode, StackManipulation.Size size)

Creates a new widening stack manipulation.

Parameters
conversionOpcode:int

The opcode for executing the conversion.

size:StackManipulation.Size

The size change of applying the conversion.

Method Detail

applyback to summary
public StackManipulation.Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext)

Implements net.bytebuddy.implementation.bytecode.StackManipulation.apply.

Doc from net.bytebuddy.implementation.bytecode.StackManipulation.apply.

Applies the stack manipulation that is described by this instance.

Parameters
methodVisitor:MethodVisitor

The method visitor used to write the method implementation to.

implementationContext:Implementation.Context

The context of the current implementation.

Returns:StackManipulation.Size

The changes to the size of the operand stack that are implied by this stack manipulation.