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

public final Enum PrimitiveUnboxingDelegate

extends Enum<PrimitiveUnboxingDelegate>
implements StackManipulation
Class Inheritance
All Implemented Interfaces
org.easymock.bytebuddy.implementation.bytecode.StackManipulation
Imports
org.easymock.bytebuddy.build.HashCodeAndEqualsPlugin, org.easymock.bytebuddy.description.type.TypeDefinition, .TypeDescription, org.easymock.bytebuddy.implementation.Implementation, org.easymock.bytebuddy.implementation.bytecode.StackManipulation, .StackSize, org.easymock.bytebuddy.implementation.bytecode.assign.Assigner, org.easymock.bytebuddy.jar.asm.MethodVisitor, .Opcodes

This delegate is responsible for unboxing a wrapper type to their primitive equivalents.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static enum
PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible

An explicitly types unboxing responsible is applied for directly unboxing a wrapper type.

protected static class
PrimitiveUnboxingDelegate.ImplicitlyTypedUnboxingResponsible

An unboxing responsible for an implicitly typed value.

public static interface
PrimitiveUnboxingDelegate.UnboxingResponsible

Implementations represent an unboxing delegate that is able to perform the unboxing operation.

Field Summary

Modifier and TypeField and Description
public static final PrimitiveUnboxingDelegate
BOOLEAN

The unboxing delegate for Boolean types.

public static final PrimitiveUnboxingDelegate
BYTE

The unboxing delegate for Byte types.

public static final PrimitiveUnboxingDelegate
CHARACTER

The unboxing delegate for Character types.

public static final PrimitiveUnboxingDelegate
DOUBLE

The unboxing delegate for Double types.

public static final PrimitiveUnboxingDelegate
FLOAT

The unboxing delegate for Float types.

public static final PrimitiveUnboxingDelegate
INTEGER

The unboxing delegate for Integer types.

public static final PrimitiveUnboxingDelegate
LONG

The unboxing delegate for Long types.

private final TypeDescription
primitiveType

The represented primitive type.

public static final PrimitiveUnboxingDelegate
SHORT

The unboxing delegate for Short types.

private final StackManipulation.Size
size

The size increase after a wrapper type was unwrapped.

private final String
unboxingMethodDescriptor

The descriptor of the method for unboxing a wrapper value to its primitive value.

private final String
unboxingMethodName

The name of the method for unboxing a wrapper value to its primitive value.

private final TypeDescription
wrapperType

The wrapper type of the represented primitive type.

Constructor Summary

AccessConstructor and Description
private
PrimitiveUnboxingDelegate(Class<?>
The wrapper type of the represented primitive type.
wrapperType
,
Class<?>
The represented primitive type.
primitiveType
,
StackSize
The size difference between the wrapper type and its primitive value.
sizeDifference
,
String
The name of the method for unboxing a wrapper value to its primitive value.
unboxingMethodName
,
String
The descriptor of the method for unboxing a wrapper value to its primitive value.
unboxingMethodDescriptor
)

Creates a new primitive unboxing delegate.

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 org.easymock.bytebuddy.implementation.bytecode.StackManipulation.apply.

Applies the stack manipulation that is described by this instance.
public static PrimitiveUnboxingDelegate

Returns:

A corresponding primitive unboxing delegate.
forPrimitive
(TypeDefinition
A description of the primitive type.
typeDefinition
)

Locates a primitive unboxing delegate for a given primitive type.

public static PrimitiveUnboxingDelegate.UnboxingResponsible

Returns:

An unboxing responsible capable of performing an unboxing operation while considering a further assignment of the unboxed value.
forReferenceType
(TypeDefinition
A non-primitive type.
typeDefinition
)

Creates an unboxing responsible that is capable of unboxing a wrapper type.

protected TypeDescription.Generic

Returns:

A generic version of this delegate's wrapper type.
getWrapperType
()

Returns the wrapper type that this unboxing delegate represents.

public boolean
isValid()

Implements org.easymock.bytebuddy.implementation.bytecode.StackManipulation.isValid.

Determines if this stack manipulation is valid.
public static PrimitiveUnboxingDelegate
public static PrimitiveUnboxingDelegate[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BOOLEANback to summary
public static final PrimitiveUnboxingDelegate BOOLEAN

The unboxing delegate for Boolean types.

BYTEback to summary
public static final PrimitiveUnboxingDelegate BYTE

The unboxing delegate for Byte types.

CHARACTERback to summary
public static final PrimitiveUnboxingDelegate CHARACTER

The unboxing delegate for Character types.

DOUBLEback to summary
public static final PrimitiveUnboxingDelegate DOUBLE

The unboxing delegate for Double types.

FLOATback to summary
public static final PrimitiveUnboxingDelegate FLOAT

The unboxing delegate for Float types.

INTEGERback to summary
public static final PrimitiveUnboxingDelegate INTEGER

The unboxing delegate for Integer types.

LONGback to summary
public static final PrimitiveUnboxingDelegate LONG

The unboxing delegate for Long types.

primitiveTypeback to summary
private final TypeDescription primitiveType

The represented primitive type.

SHORTback to summary
public static final PrimitiveUnboxingDelegate SHORT

The unboxing delegate for Short types.

sizeback to summary
private final StackManipulation.Size size

The size increase after a wrapper type was unwrapped.

unboxingMethodDescriptorback to summary
private final String unboxingMethodDescriptor

The descriptor of the method for unboxing a wrapper value to its primitive value.

unboxingMethodNameback to summary
private final String unboxingMethodName

The name of the method for unboxing a wrapper value to its primitive value.

wrapperTypeback to summary
private final TypeDescription wrapperType

The wrapper type of the represented primitive type.

Constructor Detail

PrimitiveUnboxingDelegateback to summary
private PrimitiveUnboxingDelegate(Class<?> wrapperType, Class<?> primitiveType, StackSize sizeDifference, String unboxingMethodName, String unboxingMethodDescriptor)

Creates a new primitive unboxing delegate.

Parameters
wrapperType:Class<?>

The wrapper type of the represented primitive type.

primitiveType:Class<?>

The represented primitive type.

sizeDifference:StackSize

The size difference between the wrapper type and its primitive value.

unboxingMethodName:String

The name of the method for unboxing a wrapper value to its primitive value.

unboxingMethodDescriptor:String

The descriptor of the method for unboxing a wrapper value to its primitive value.

Method Detail

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

Implements org.easymock.bytebuddy.implementation.bytecode.StackManipulation.apply.

Doc from org.easymock.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.

forPrimitiveback to summary
public static PrimitiveUnboxingDelegate forPrimitive(TypeDefinition typeDefinition)

Locates a primitive unboxing delegate for a given primitive type.

Parameters
typeDefinition:TypeDefinition

A description of the primitive type.

Returns:PrimitiveUnboxingDelegate

A corresponding primitive unboxing delegate.

forReferenceTypeback to summary
public static PrimitiveUnboxingDelegate.UnboxingResponsible forReferenceType(TypeDefinition typeDefinition)

Creates an unboxing responsible that is capable of unboxing a wrapper type.

  1. If the reference type represents a wrapper type, the wrapper type will simply be unboxed.
  2. If the reference type does not represent a wrapper type, the wrapper type will be inferred by the primitive target type that is later given to the org.easymock.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveUnboxingDelegate.UnboxingResponsible in order to then check if the given type is assignable to the inferred wrapper type.
Parameters
typeDefinition:TypeDefinition

A non-primitive type.

Returns:PrimitiveUnboxingDelegate.UnboxingResponsible

An unboxing responsible capable of performing an unboxing operation while considering a further assignment of the unboxed value.

getWrapperTypeback to summary
protected TypeDescription.Generic getWrapperType()

Returns the wrapper type that this unboxing delegate represents.

Returns:TypeDescription.Generic

A generic version of this delegate's wrapper type.

isValidback to summary
public boolean isValid()

Implements org.easymock.bytebuddy.implementation.bytecode.StackManipulation.isValid.

Doc from org.easymock.bytebuddy.implementation.bytecode.StackManipulation.isValid.

Determines if this stack manipulation is valid.

Returns:boolean

If false, this manipulation cannot be applied and should throw an exception.

valueOfback to summary
public static PrimitiveUnboxingDelegate valueOf(String name)
valuesback to summary
public static PrimitiveUnboxingDelegate[] values()
org.easymock.bytebuddy.implementation.bytecode.assign.primitive back to summary

protected final Enum PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible

extends Enum<PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible>
implements UnboxingResponsible
Class Inheritance
  • java.lang.Object
  • java.lang.Enum
  • org.easymock.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible
All Implemented Interfaces
org.easymock.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveUnboxingDelegate.UnboxingResponsible

An explicitly types unboxing responsible is applied for directly unboxing a wrapper type.

Field Summary

Modifier and TypeField and Description
public static final PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible
BOOLEAN

An unboxing responsible for unboxing a java.lang.Boolean type.

public static final PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible
BYTE

An unboxing responsible for unboxing a java.lang.Byte type.

public static final PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible
CHARACTER

An unboxing responsible for unboxing a java.lang.Character type.

public static final PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible
DOUBLE

An unboxing responsible for unboxing a java.lang.Double type.

public static final PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible
FLOAT

An unboxing responsible for unboxing a java.lang.Float type.

public static final PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible
INTEGER

An unboxing responsible for unboxing a java.lang.Integer type.

public static final PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible
LONG

An unboxing responsible for unboxing a java.lang.Long type.

private final PrimitiveUnboxingDelegate
primitiveUnboxingDelegate

The primitive unboxing delegate for handling the given wrapper type.

public static final PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible
SHORT

An unboxing responsible for unboxing a java.lang.Short type.

Constructor Summary

AccessConstructor and Description
private
ExplicitlyTypedUnboxingResponsible(PrimitiveUnboxingDelegate
The primitive unboxing delegate for handling the given wrapper type.
primitiveUnboxingDelegate
)

Creates a new explicitly typed unboxing responsible.

Method Summary

Modifier and TypeMethod and Description
public StackManipulation
assignUnboxedTo(TypeDescription.Generic
The type that is the desired outcome of the assignment.
targetType
,
Assigner
The assigner used to assign the unboxed type to the target type.
assigner
,
Assigner.Typing
Determines if a type-casting should be attempted for incompatible types.
typing
)

Implements org.easymock.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveUnboxingDelegate.UnboxingResponsible.assignUnboxedTo.

Attempts to unbox the represented type in order to assign the unboxed value to the given target type while using the assigner that is provided by the method call.
public static PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible
public static PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BOOLEANback to summary
public static final PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible BOOLEAN

An unboxing responsible for unboxing a java.lang.Boolean type.

BYTEback to summary
public static final PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible BYTE

An unboxing responsible for unboxing a java.lang.Byte type.

CHARACTERback to summary
public static final PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible CHARACTER

An unboxing responsible for unboxing a java.lang.Character type.

DOUBLEback to summary
public static final PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible DOUBLE

An unboxing responsible for unboxing a java.lang.Double type.

FLOATback to summary
public static final PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible FLOAT

An unboxing responsible for unboxing a java.lang.Float type.

INTEGERback to summary
public static final PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible INTEGER

An unboxing responsible for unboxing a java.lang.Integer type.

LONGback to summary
public static final PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible LONG

An unboxing responsible for unboxing a java.lang.Long type.

primitiveUnboxingDelegateback to summary
private final PrimitiveUnboxingDelegate primitiveUnboxingDelegate

The primitive unboxing delegate for handling the given wrapper type.

SHORTback to summary
public static final PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible SHORT

An unboxing responsible for unboxing a java.lang.Short type.

Constructor Detail

ExplicitlyTypedUnboxingResponsibleback to summary
private ExplicitlyTypedUnboxingResponsible(PrimitiveUnboxingDelegate primitiveUnboxingDelegate)

Creates a new explicitly typed unboxing responsible.

Parameters
primitiveUnboxingDelegate:PrimitiveUnboxingDelegate

The primitive unboxing delegate for handling the given wrapper type.

Method Detail

assignUnboxedToback to summary
public StackManipulation assignUnboxedTo(TypeDescription.Generic targetType, Assigner assigner, Assigner.Typing typing)

Implements org.easymock.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveUnboxingDelegate.UnboxingResponsible.assignUnboxedTo.

Doc from org.easymock.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveUnboxingDelegate.UnboxingResponsible.assignUnboxedTo.

Attempts to unbox the represented type in order to assign the unboxed value to the given target type while using the assigner that is provided by the method call.

Parameters
targetType:TypeDescription.Generic

The type that is the desired outcome of the assignment.

assigner:Assigner

The assigner used to assign the unboxed type to the target type.

typing:Assigner.Typing

Determines if a type-casting should be attempted for incompatible types.

Returns:StackManipulation

A stack manipulation representing this assignment if such an assignment is possible. An illegal assignment otherwise.

valueOfback to summary
public static PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible valueOf(String name)
valuesback to summary
public static PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible[] values()
org.easymock.bytebuddy.implementation.bytecode.assign.primitive back to summary

protected Class PrimitiveUnboxingDelegate.ImplicitlyTypedUnboxingResponsible

extends Object
implements UnboxingResponsible
Class Inheritance
  • java.lang.Object
  • org.easymock.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveUnboxingDelegate.ImplicitlyTypedUnboxingResponsible
All Implemented Interfaces
org.easymock.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveUnboxingDelegate.UnboxingResponsible
Annotations
@Enhance

An unboxing responsible for an implicitly typed value. This implementation is applied for source types that were not found to be of a given wrapper type. Instead, this unboxing responsible tries to assign the source type to the primitive target type's wrapper type before performing an unboxing operation.

Field Summary

Modifier and TypeField and Description
private final TypeDescription.Generic
originalType

The original type which should be unboxed but is not of any known wrapper type.

Constructor Summary

AccessConstructor and Description
protected
ImplicitlyTypedUnboxingResponsible(TypeDescription.Generic
The original type which should be unboxed but is not of any known wrapper type.
originalType
)

Creates a new implicitly typed unboxing responsible.

Method Summary

Modifier and TypeMethod and Description
public StackManipulation
assignUnboxedTo(TypeDescription.Generic
The type that is the desired outcome of the assignment.
target
,
Assigner
The assigner used to assign the unboxed type to the target type.
assigner
,
Assigner.Typing
Determines if a type-casting should be attempted for incompatible types.
typing
)

Implements org.easymock.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveUnboxingDelegate.UnboxingResponsible.assignUnboxedTo.

Attempts to unbox the represented type in order to assign the unboxed value to the given target type while using the assigner that is provided by the method call.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

originalTypeback to summary
private final TypeDescription.Generic originalType

The original type which should be unboxed but is not of any known wrapper type.

Constructor Detail

ImplicitlyTypedUnboxingResponsibleback to summary
protected ImplicitlyTypedUnboxingResponsible(TypeDescription.Generic originalType)

Creates a new implicitly typed unboxing responsible.

Parameters
originalType:TypeDescription.Generic

The original type which should be unboxed but is not of any known wrapper type.

Method Detail

assignUnboxedToback to summary
public StackManipulation assignUnboxedTo(TypeDescription.Generic target, Assigner assigner, Assigner.Typing typing)

Implements org.easymock.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveUnboxingDelegate.UnboxingResponsible.assignUnboxedTo.

Doc from org.easymock.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveUnboxingDelegate.UnboxingResponsible.assignUnboxedTo.

Attempts to unbox the represented type in order to assign the unboxed value to the given target type while using the assigner that is provided by the method call.

Parameters
target:TypeDescription.Generic

The type that is the desired outcome of the assignment.

assigner:Assigner

The assigner used to assign the unboxed type to the target type.

typing:Assigner.Typing

Determines if a type-casting should be attempted for incompatible types.

Returns:StackManipulation

A stack manipulation representing this assignment if such an assignment is possible. An illegal assignment otherwise.

org.easymock.bytebuddy.implementation.bytecode.assign.primitive back to summary

public Interface PrimitiveUnboxingDelegate.UnboxingResponsible

Known Direct Implementers
org.easymock.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveUnboxingDelegate.ImplicitlyTypedUnboxingResponsible, org.easymock.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveUnboxingDelegate.ExplicitlyTypedUnboxingResponsible

Implementations represent an unboxing delegate that is able to perform the unboxing operation.

Method Summary

Modifier and TypeMethod and Description
public StackManipulation

Returns:

A stack manipulation representing this assignment if such an assignment is possible. An illegal assignment otherwise.
assignUnboxedTo
(TypeDescription.Generic
The type that is the desired outcome of the assignment.
target
,
Assigner
The assigner used to assign the unboxed type to the target type.
assigner
,
Assigner.Typing
Determines if a type-casting should be attempted for incompatible types.
typing
)

Attempts to unbox the represented type in order to assign the unboxed value to the given target type while using the assigner that is provided by the method call.

Method Detail

assignUnboxedToback to summary
public StackManipulation assignUnboxedTo(TypeDescription.Generic target, Assigner assigner, Assigner.Typing typing)

Attempts to unbox the represented type in order to assign the unboxed value to the given target type while using the assigner that is provided by the method call.

Parameters
target:TypeDescription.Generic

The type that is the desired outcome of the assignment.

assigner:Assigner

The assigner used to assign the unboxed type to the target type.

typing:Assigner.Typing

Determines if a type-casting should be attempted for incompatible types.

Returns:StackManipulation

A stack manipulation representing this assignment if such an assignment is possible. An illegal assignment otherwise.