Enum GenericTypeAwareAssigner
java.lang.Object
java.lang.Enum<GenericTypeAwareAssigner>
net.bytebuddy.implementation.bytecode.assign.reference.GenericTypeAwareAssigner
- All Implemented Interfaces:
Serializable
,Comparable<GenericTypeAwareAssigner>
,java.lang.constant.Constable
,Assigner
An assigner implementation that considers generic type assignability.
Important: This implementation does not currently support method variables and their type inference.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
A visitor for generic types that determines assignability of such types.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bytecode.assign.Assigner
Assigner.EqualTypesOnly, Assigner.Refusing, Assigner.Typing
-
Enum Constant Summary
Enum Constants -
Field Summary
Fields inherited from interface net.bytebuddy.implementation.bytecode.assign.Assigner
DEFAULT, GENERICS_AWARE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassign
(TypeDescription.Generic source, TypeDescription.Generic target, Assigner.Typing typing) static GenericTypeAwareAssigner
Returns the enum constant of this type with the specified name.static GenericTypeAwareAssigner[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
The singleton instance.
-
-
Constructor Details
-
GenericTypeAwareAssigner
private GenericTypeAwareAssigner()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
assign
public StackManipulation assign(TypeDescription.Generic source, TypeDescription.Generic target, Assigner.Typing typing) - Specified by:
assign
in interfaceAssigner
- Parameters:
source
- The original type that is to be transformed into thetargetType
.target
- The target type into which thesourceType
is to be converted.typing
- A hint whether the assignment should consider the runtime type of the source type, i.e. if type down or cross castings are allowed. If this hint is set, this is also an indication thatvoid
to non-void
assignments are permitted.- Returns:
- A stack manipulation that transforms the
sourceType
into thetargetType
if this is possible. An illegal stack manipulation otherwise.
-