Enum GenericTypeAwareAssigner
- java.lang.Object
-
- java.lang.Enum<GenericTypeAwareAssigner>
-
- net.bytebuddy.implementation.bytecode.assign.reference.GenericTypeAwareAssigner
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<GenericTypeAwareAssigner>
,Assigner
public enum GenericTypeAwareAssigner extends java.lang.Enum<GenericTypeAwareAssigner> implements 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 Classes Modifier and Type Class Description protected static class
GenericTypeAwareAssigner.IsAssignableToVisitor
A visitor for generic types that determines assignability of such types.-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bytecode.assign.Assigner
Assigner.EqualTypesOnly, Assigner.Refusing, Assigner.Typing
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
The singleton instance.
-
Field Summary
-
Fields inherited from interface net.bytebuddy.implementation.bytecode.assign.Assigner
DEFAULT, GENERICS_AWARE
-
-
Constructor Summary
Constructors Modifier Constructor Description private
GenericTypeAwareAssigner()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StackManipulation
assign(TypeDescription.Generic source, TypeDescription.Generic target, Assigner.Typing typing)
static GenericTypeAwareAssigner
valueOf(java.lang.String name)
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 Detail
-
INSTANCE
public static final GenericTypeAwareAssigner INSTANCE
The singleton instance.
-
-
Method Detail
-
values
public static GenericTypeAwareAssigner[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (GenericTypeAwareAssigner c : GenericTypeAwareAssigner.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GenericTypeAwareAssigner valueOf(java.lang.String name)
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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- 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.
-
-