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

public final Enum GenericTypeAwareAssigner

extends Enum<GenericTypeAwareAssigner>
implements Assigner
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.bytecode.assign.Assigner
Imports
edu.umd.cs.findbugs.annotations.SuppressFBWarnings, net.bytebuddy.build.HashCodeAndEqualsPlugin, net.bytebuddy.description.type.TypeDescription, .TypeList, net.bytebuddy.implementation.bytecode.StackManipulation, net.bytebuddy.implementation.bytecode.assign.Assigner, .TypeCasting, net.bytebuddy.utility.QueueFactory, java.util.*

An assigner implementation that considers generic type assignability.

Important Note

This implementation does not currently support method variables and their type inference.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
GenericTypeAwareAssigner.IsAssignableToVisitor

A visitor for generic types that determines assignability of such types.

Field Summary

Modifier and TypeField and Description
public static final GenericTypeAwareAssigner
INSTANCE

The singleton instance.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public StackManipulation
assign(TypeDescription.Generic
The original type that is to be transformed into the targetType.
source
,
TypeDescription.Generic
The target type into which the sourceType is to be converted.
target
,
Assigner.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 that void to non-void assignments are permitted.
typing
)

Implements net.bytebuddy.implementation.bytecode.assign.Assigner.assign.

public static GenericTypeAwareAssigner
public static GenericTypeAwareAssigner[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final GenericTypeAwareAssigner INSTANCE

The singleton instance.

Constructor Detail

GenericTypeAwareAssignerback to summary
private GenericTypeAwareAssigner()

Method Detail

assignback to summary
public StackManipulation assign(TypeDescription.Generic source, TypeDescription.Generic target, Assigner.Typing typing)

Implements net.bytebuddy.implementation.bytecode.assign.Assigner.assign.

Parameters
source:TypeDescription.Generic

Doc from net.bytebuddy.implementation.bytecode.assign.Assigner.assign.

The original type that is to be transformed into the targetType.

target:TypeDescription.Generic

Doc from net.bytebuddy.implementation.bytecode.assign.Assigner.assign.

The target type into which the sourceType is to be converted.

typing:Assigner.Typing

Doc from net.bytebuddy.implementation.bytecode.assign.Assigner.assign.

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 that void to non-void assignments are permitted.

Returns:StackManipulation

Doc from net.bytebuddy.implementation.bytecode.assign.Assigner.assign.

A stack manipulation that transforms the sourceType into the targetType if this is possible. An illegal stack manipulation otherwise.

valueOfback to summary
public static GenericTypeAwareAssigner valueOf(String name)
valuesback to summary
public static GenericTypeAwareAssigner[] values()
net.bytebuddy.implementation.bytecode.assign.reference back to summary

protected Class GenericTypeAwareAssigner.IsAssignableToVisitor

extends Object
implements TypeDescription.Generic.Visitor<Boolean>
Class Inheritance
  • java.lang.Object
  • net.bytebuddy.implementation.bytecode.assign.reference.GenericTypeAwareAssigner.IsAssignableToVisitor
All Implemented Interfaces
net.bytebuddy.description.type.TypeDescription.Generic.Visitor
Annotations
@Enhance

A visitor for generic types that determines assignability of such types.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
GenericTypeAwareAssigner.IsAssignableToVisitor.OfGenericArray

A visitor for determining assignability of a generic array type.

protected abstract static class
GenericTypeAwareAssigner.IsAssignableToVisitor.OfManifestType

An implementation of a assignability visitor that is applicable for any non-wildcard type.

protected static class
GenericTypeAwareAssigner.IsAssignableToVisitor.OfNonGenericType

A visitor for determining assignability of a non-generic type.

protected static class
GenericTypeAwareAssigner.IsAssignableToVisitor.OfParameterizedType

A visitor for determining the assignability of a parameterized type.

protected abstract static class
GenericTypeAwareAssigner.IsAssignableToVisitor.OfSimpleType

A visitor for determining assignability of a type in a type hierarchy, i.e. a non-generic or parameterized type.

protected static class
GenericTypeAwareAssigner.IsAssignableToVisitor.OfWildcard

A visitor to determine the assignability of a wildcard type.

Field Summary

Modifier and TypeField and Description
private final boolean
polymorphic

true if the assignment is polymorphic.

private final TypeDescription.Generic
typeDescription

The type to which another type is being assigned.

Constructor Summary

AccessConstructor and Description
public
IsAssignableToVisitor(TypeDescription.Generic
The type to which another type is being assigned.
typeDescription
)

Creates a new visitor to determine assignability of the supplied type.

protected
IsAssignableToVisitor(TypeDescription.Generic
The type to which another type is being assigned.
typeDescription
,
boolean
true if the assignment is polymorphic.
polymorphic
)

Creates a new visitor to determine assignability of the supplied type.

Method Summary

Modifier and TypeMethod and Description
public Boolean
public Boolean
public Boolean
public Boolean
public Boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

polymorphicback to summary
private final boolean polymorphic

true if the assignment is polymorphic.

typeDescriptionback to summary
private final TypeDescription.Generic typeDescription

The type to which another type is being assigned.

Constructor Detail

IsAssignableToVisitorback to summary
public IsAssignableToVisitor(TypeDescription.Generic typeDescription)

Creates a new visitor to determine assignability of the supplied type.

Parameters
typeDescription:TypeDescription.Generic

The type to which another type is being assigned.

IsAssignableToVisitorback to summary
protected IsAssignableToVisitor(TypeDescription.Generic typeDescription, boolean polymorphic)

Creates a new visitor to determine assignability of the supplied type.

Parameters
typeDescription:TypeDescription.Generic

The type to which another type is being assigned.

polymorphic:boolean

true if the assignment is polymorphic.

Method Detail

onGenericArrayback to summary
public Boolean onGenericArray(TypeDescription.Generic genericArray)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onGenericArray.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onGenericArray.

Visits a generic array type (Sort#GENERIC_ARRAY).

Parameters
genericArray:TypeDescription.Generic

The generic array type.

Returns:Boolean

The visitor's return value.

onNonGenericTypeback to summary
public Boolean onNonGenericType(TypeDescription.Generic typeDescription)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onNonGenericType.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onNonGenericType.

Visits a non-generic type (Sort#NON_GENERIC).

Parameters
typeDescription:TypeDescription.Generic

The non-generic type.

Returns:Boolean

The visitor's return value.

onParameterizedTypeback to summary
public Boolean onParameterizedType(TypeDescription.Generic parameterizedType)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onParameterizedType.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onParameterizedType.

Visits a parameterized type (Sort#PARAMETERIZED).

Parameters
parameterizedType:TypeDescription.Generic

The generic array type.

Returns:Boolean

The visitor's return value.

onTypeVariableback to summary
public Boolean onTypeVariable(TypeDescription.Generic typeVariable)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onTypeVariable.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onTypeVariable.

Visits a type variable (Sort#VARIABLE, Sort#VARIABLE_SYMBOLIC).

Parameters
typeVariable:TypeDescription.Generic

The generic array type.

Returns:Boolean

The visitor's return value.

onWildcardback to summary
public Boolean onWildcard(TypeDescription.Generic wildcard)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onWildcard.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onWildcard.

Visits a wildcard (Sort#WILDCARD).

Parameters
wildcard:TypeDescription.Generic

The wildcard.

Returns:Boolean

The visitor's return value.

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

protected Class GenericTypeAwareAssigner.IsAssignableToVisitor.OfGenericArray

extends OfManifestType
Class Inheritance

A visitor for determining assignability of a generic array type.

Constructor Summary

AccessConstructor and Description
protected
OfGenericArray(TypeDescription.Generic
The type being assigned to another type.
typeDescription
,
boolean
true if the assignment is polymorphic.
polymorphic
)

Creates a new visitor.

Constructor Detail

OfGenericArrayback to summary
protected OfGenericArray(TypeDescription.Generic typeDescription, boolean polymorphic)

Creates a new visitor.

Parameters
typeDescription:TypeDescription.Generic

The type being assigned to another type.

polymorphic:boolean

true if the assignment is polymorphic.

Method Detail

onGenericArrayback to summary
public Boolean onGenericArray(TypeDescription.Generic genericArray)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onGenericArray.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onGenericArray.

Visits a generic array type (Sort#GENERIC_ARRAY).

Parameters
genericArray:TypeDescription.Generic

The generic array type.

Returns:Boolean

The visitor's return value.

Annotations
@SuppressFBWarnings:NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE
justification:Assuming component type for array type.
onNonGenericTypeback to summary
public Boolean onNonGenericType(TypeDescription.Generic typeDescription)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onNonGenericType.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onNonGenericType.

Visits a non-generic type (Sort#NON_GENERIC).

Parameters
typeDescription:TypeDescription.Generic

The non-generic type.

Returns:Boolean

The visitor's return value.

onParameterizedTypeback to summary
public Boolean onParameterizedType(TypeDescription.Generic parameterizedType)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onParameterizedType.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onParameterizedType.

Visits a parameterized type (Sort#PARAMETERIZED).

Parameters
parameterizedType:TypeDescription.Generic

The generic array type.

Returns:Boolean

The visitor's return value.

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

protected abstract Class GenericTypeAwareAssigner.IsAssignableToVisitor.OfManifestType

extends Object
implements TypeDescription.Generic.Visitor<Boolean>
Class Inheritance
  • java.lang.Object
  • net.bytebuddy.implementation.bytecode.assign.reference.GenericTypeAwareAssigner.IsAssignableToVisitor.OfManifestType
All Implemented Interfaces
net.bytebuddy.description.type.TypeDescription.Generic.Visitor
Known Direct Subclasses
net.bytebuddy.implementation.bytecode.assign.reference.GenericTypeAwareAssigner.IsAssignableToVisitor.OfSimpleType, net.bytebuddy.implementation.bytecode.assign.reference.GenericTypeAwareAssigner.IsAssignableToVisitor.OfGenericArray
Annotations
@Enhance

An implementation of a assignability visitor that is applicable for any non-wildcard type.

Field Summary

Modifier and TypeField and Description
protected final boolean
polymorphic

true if the assignment is polymorphic.

protected final TypeDescription.Generic
typeDescription

The type being assigned to another type.

Constructor Summary

AccessConstructor and Description
protected
OfManifestType(TypeDescription.Generic
The type being assigned to another type.
typeDescription
,
boolean
true if the assignment is polymorphic.
polymorphic
)

Creates a new visitor for a manifest type.

Field Detail

polymorphicback to summary
protected final boolean polymorphic

true if the assignment is polymorphic.

typeDescriptionback to summary
protected final TypeDescription.Generic typeDescription

The type being assigned to another type.

Constructor Detail

OfManifestTypeback to summary
protected OfManifestType(TypeDescription.Generic typeDescription, boolean polymorphic)

Creates a new visitor for a manifest type.

Parameters
typeDescription:TypeDescription.Generic

The type being assigned to another type.

polymorphic:boolean

true if the assignment is polymorphic.

Method Detail

onTypeVariableback to summary
public Boolean onTypeVariable(TypeDescription.Generic typeVariable)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onTypeVariable.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onTypeVariable.

Visits a type variable (Sort#VARIABLE, Sort#VARIABLE_SYMBOLIC).

Parameters
typeVariable:TypeDescription.Generic

The generic array type.

Returns:Boolean

The visitor's return value.

onWildcardback to summary
public Boolean onWildcard(TypeDescription.Generic wildcard)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onWildcard.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onWildcard.

Visits a wildcard (Sort#WILDCARD).

Parameters
wildcard:TypeDescription.Generic

The wildcard.

Returns:Boolean

The visitor's return value.

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

protected Class GenericTypeAwareAssigner.IsAssignableToVisitor.OfNonGenericType

extends OfSimpleType
Class Inheritance

A visitor for determining assignability of a non-generic type.

Constructor Summary

AccessConstructor and Description
protected
OfNonGenericType(TypeDescription.Generic
The type being assigned to another type.
typeDescription
,
boolean
true if the assignment is polymorphic.
polymorphic
)

Creates a new visitor.

Constructor Detail

OfNonGenericTypeback to summary
protected OfNonGenericType(TypeDescription.Generic typeDescription, boolean polymorphic)

Creates a new visitor.

Parameters
typeDescription:TypeDescription.Generic

The type being assigned to another type.

polymorphic:boolean

true if the assignment is polymorphic.

Method Detail

onGenericArrayback to summary
public Boolean onGenericArray(TypeDescription.Generic genericArray)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onGenericArray.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onGenericArray.

Visits a generic array type (Sort#GENERIC_ARRAY).

Parameters
genericArray:TypeDescription.Generic

The generic array type.

Returns:Boolean

The visitor's return value.

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

protected Class GenericTypeAwareAssigner.IsAssignableToVisitor.OfParameterizedType

extends OfSimpleType
Class Inheritance

A visitor for determining the assignability of a parameterized type.

Constructor Summary

AccessConstructor and Description
protected
OfParameterizedType(TypeDescription.Generic
The type being assigned to another type.
typeDescription
,
boolean
true if the assignment is polymorphic.
polymorphic
)

Creates a new visitor.

Constructor Detail

OfParameterizedTypeback to summary
protected OfParameterizedType(TypeDescription.Generic typeDescription, boolean polymorphic)

Creates a new visitor.

Parameters
typeDescription:TypeDescription.Generic

The type being assigned to another type.

polymorphic:boolean

true if the assignment is polymorphic.

Method Detail

onGenericArrayback to summary
public Boolean onGenericArray(TypeDescription.Generic genericArray)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onGenericArray.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onGenericArray.

Visits a generic array type (Sort#GENERIC_ARRAY).

Parameters
genericArray:TypeDescription.Generic

The generic array type.

Returns:Boolean

The visitor's return value.

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

protected abstract Class GenericTypeAwareAssigner.IsAssignableToVisitor.OfSimpleType

extends OfManifestType
Class Inheritance
Known Direct Subclasses
net.bytebuddy.implementation.bytecode.assign.reference.GenericTypeAwareAssigner.IsAssignableToVisitor.OfParameterizedType, net.bytebuddy.implementation.bytecode.assign.reference.GenericTypeAwareAssigner.IsAssignableToVisitor.OfNonGenericType

A visitor for determining assignability of a type in a type hierarchy, i.e. a non-generic or parameterized type.

Constructor Summary

AccessConstructor and Description
protected
OfSimpleType(TypeDescription.Generic
The type being assigned to another type.
typeDescription
,
boolean
true if the assignment is polymorphic.
polymorphic
)

Creates a new visitor.

Constructor Detail

OfSimpleTypeback to summary
protected OfSimpleType(TypeDescription.Generic typeDescription, boolean polymorphic)

Creates a new visitor.

Parameters
typeDescription:TypeDescription.Generic

The type being assigned to another type.

polymorphic:boolean

true if the assignment is polymorphic.

Method Detail

onNonGenericTypeback to summary
public Boolean onNonGenericType(TypeDescription.Generic typeDescription)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onNonGenericType.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onNonGenericType.

Visits a non-generic type (Sort#NON_GENERIC).

Parameters
typeDescription:TypeDescription.Generic

The non-generic type.

Returns:Boolean

The visitor's return value.

onParameterizedTypeback to summary
public Boolean onParameterizedType(TypeDescription.Generic parameterizedType)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onParameterizedType.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onParameterizedType.

Visits a parameterized type (Sort#PARAMETERIZED).

Parameters
parameterizedType:TypeDescription.Generic

The generic array type.

Returns:Boolean

The visitor's return value.

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

protected Class GenericTypeAwareAssigner.IsAssignableToVisitor.OfWildcard

extends Object
implements TypeDescription.Generic.Visitor<Boolean>
Class Inheritance
  • java.lang.Object
  • net.bytebuddy.implementation.bytecode.assign.reference.GenericTypeAwareAssigner.IsAssignableToVisitor.OfWildcard
All Implemented Interfaces
net.bytebuddy.description.type.TypeDescription.Generic.Visitor
Annotations
@Enhance

A visitor to determine the assignability of a wildcard type.

Field Summary

Modifier and TypeField and Description
private final TypeDescription.Generic
wildcard

The wildcard type being assigned to another type.

Constructor Summary

AccessConstructor and Description
protected
OfWildcard(TypeDescription.Generic
The wildcard type being assigned to another type.
wildcard
)

Creates a visitor for a wildcard type assignment.

Field Detail

wildcardback to summary
private final TypeDescription.Generic wildcard

The wildcard type being assigned to another type.

Constructor Detail

OfWildcardback to summary
protected OfWildcard(TypeDescription.Generic wildcard)

Creates a visitor for a wildcard type assignment.

Parameters
wildcard:TypeDescription.Generic

The wildcard type being assigned to another type.

Method Detail

onGenericArrayback to summary
public Boolean onGenericArray(TypeDescription.Generic genericArray)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onGenericArray.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onGenericArray.

Visits a generic array type (Sort#GENERIC_ARRAY).

Parameters
genericArray:TypeDescription.Generic

The generic array type.

Returns:Boolean

The visitor's return value.

onNonGenericTypeback to summary
public Boolean onNonGenericType(TypeDescription.Generic typeDescription)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onNonGenericType.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onNonGenericType.

Visits a non-generic type (Sort#NON_GENERIC).

Parameters
typeDescription:TypeDescription.Generic

The non-generic type.

Returns:Boolean

The visitor's return value.

onParameterizedTypeback to summary
public Boolean onParameterizedType(TypeDescription.Generic parameterizedType)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onParameterizedType.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onParameterizedType.

Visits a parameterized type (Sort#PARAMETERIZED).

Parameters
parameterizedType:TypeDescription.Generic

The generic array type.

Returns:Boolean

The visitor's return value.

onTypeVariableback to summary
public Boolean onTypeVariable(TypeDescription.Generic typeVariable)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onTypeVariable.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onTypeVariable.

Visits a type variable (Sort#VARIABLE, Sort#VARIABLE_SYMBOLIC).

Parameters
typeVariable:TypeDescription.Generic

The generic array type.

Returns:Boolean

The visitor's return value.

onWildcardback to summary
public Boolean onWildcard(TypeDescription.Generic wildcard)

Implements net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onWildcard.

Doc from net.bytebuddy.description.type.TypeDescription.Generic.Visitor.onWildcard.

Visits a wildcard (Sort#WILDCARD).

Parameters
wildcard:TypeDescription.Generic

The wildcard.

Returns:Boolean

The visitor's return value.