Class PrimitiveUnboxingDelegate.ImplicitlyTypedUnboxingResponsible
- java.lang.Object
-
- net.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveUnboxingDelegate.ImplicitlyTypedUnboxingResponsible
-
- All Implemented Interfaces:
PrimitiveUnboxingDelegate.UnboxingResponsible
- Enclosing class:
- PrimitiveUnboxingDelegate
@Enhance protected static class PrimitiveUnboxingDelegate.ImplicitlyTypedUnboxingResponsible extends java.lang.Object implements PrimitiveUnboxingDelegate.UnboxingResponsible
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
Fields Modifier and Type Field Description private TypeDescription.Generic
originalType
The original type which should be unboxed but is not of any known wrapper type.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ImplicitlyTypedUnboxingResponsible(TypeDescription.Generic originalType)
Creates a new implicitly typed unboxing responsible.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
Field Detail
-
originalType
private final TypeDescription.Generic originalType
The original type which should be unboxed but is not of any known wrapper type.
-
-
Constructor Detail
-
ImplicitlyTypedUnboxingResponsible
protected ImplicitlyTypedUnboxingResponsible(TypeDescription.Generic originalType)
Creates a new implicitly typed unboxing responsible.- Parameters:
originalType
- The original type which should be unboxed but is not of any known wrapper type.
-
-
Method Detail
-
assignUnboxedTo
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.- Specified by:
assignUnboxedTo
in interfacePrimitiveUnboxingDelegate.UnboxingResponsible
- Parameters:
target
- The type that is the desired outcome of the assignment.assigner
- The assigner used to assign the unboxed type to the target type.typing
- Determines if a type-casting should be attempted for incompatible types.- Returns:
- A stack manipulation representing this assignment if such an assignment is possible. An illegal assignment otherwise.
-
-