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

public Interface Assigner

Known Direct Implementers
net.bytebuddy.implementation.bytecode.assign.Assigner.EqualTypesOnly, net.bytebuddy.implementation.bytecode.assign.Assigner.Refusing, net.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveTypeAwareAssigner, net.bytebuddy.implementation.bytecode.assign.primitive.VoidAwareAssigner, net.bytebuddy.implementation.bytecode.assign.reference.GenericTypeAwareAssigner, net.bytebuddy.implementation.bytecode.assign.reference.ReferenceTypeAwareAssigner
Annotations
@SuppressFBWarnings:IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION
justification:Safe initialization is implied.
Imports
edu.umd.cs.findbugs.annotations.SuppressFBWarnings, net.bytebuddy.description.type.TypeDescription, net.bytebuddy.implementation.bytecode.StackManipulation, net.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveTypeAwareAssigner, .VoidAwareAssigner, net.bytebuddy.implementation.bytecode.assign.reference.GenericTypeAwareAssigner, .ReferenceTypeAwareAssigner

An assigner is responsible for converting some type A to another type B if possible.

 

An assigner is for example responsible for type casting, auto boxing or unboxing or for the widening of primitive types.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
Assigner.EqualTypesOnly

An assigner that only allows to assign types if they are equal to another.

public static enum
Assigner.Refusing

An assigner that does not allow any assignments.

public static enum
Assigner.Typing

Indicates for a type assignment, if a type casting should be applied in case that two types are not statically assignable.

Field Summary

Modifier and TypeField and Description
public static final Assigner
DEFAULT

A default assigner that can handle void, primitive types and reference types which considers generic types as raw types.

public static final Assigner
GENERICS_AWARE

A generics-aware assigner that can handle void, primitive types which reference types.

Method Summary

Modifier and TypeMethod and Description
public StackManipulation

Returns:

A stack manipulation that transforms the sourceType into the targetType if this is possible. An illegal stack manipulation otherwise.
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
)

Field Detail

DEFAULTback to summary
public static final Assigner DEFAULT

A default assigner that can handle void, primitive types and reference types which considers generic types as raw types.

GENERICS_AWAREback to summary
public static final Assigner GENERICS_AWARE

A generics-aware assigner that can handle void, primitive types which reference types.

Method Detail

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

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

target:TypeDescription.Generic

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

typing: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.

Returns:StackManipulation

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

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

public sealed Enum Assigner.EqualTypesOnly

extends Enum<Assigner.EqualTypesOnly>
implements Assigner
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.bytecode.assign.Assigner

An assigner that only allows to assign types if they are equal to another.

Field Summary

Modifier and TypeField and Description
public static final Assigner.EqualTypesOnly
ERASURE

A type assigner that considers two generic types to be equal if their erasure is equal.

public static final Assigner.EqualTypesOnly
GENERIC

An type assigner that only considers equal generic types to be assignable.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Assigner.EqualTypesOnly
public static Assigner.EqualTypesOnly[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ERASUREback to summary
public static final Assigner.EqualTypesOnly ERASURE

A type assigner that considers two generic types to be equal if their erasure is equal.

GENERICback to summary
public static final Assigner.EqualTypesOnly GENERIC

An type assigner that only considers equal generic types to be assignable.

Constructor Detail

EqualTypesOnlyback to summary
private EqualTypesOnly()

Method Detail

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

public final Enum Assigner.Refusing

extends Enum<Assigner.Refusing>
implements Assigner
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.bytecode.assign.Assigner

An assigner that does not allow any assignments.

Field Summary

Modifier and TypeField and Description
public static final Assigner.Refusing
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 Assigner.Refusing
public static Assigner.Refusing[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final Assigner.Refusing INSTANCE

The singleton instance.

Constructor Detail

Refusingback to summary
private Refusing()

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 Assigner.Refusing valueOf(String name)
valuesback to summary
public static Assigner.Refusing[] values()
net.bytebuddy.implementation.bytecode.assign back to summary

public final Enum Assigner.Typing

extends Enum<Assigner.Typing>
Class Inheritance

Indicates for a type assignment, if a type casting should be applied in case that two types are not statically assignable. Also, a dynamic typing indicates that void values are assignable to other types by assigning the target type's default value.

Field Summary

Modifier and TypeField and Description
public static final Assigner.Typing
DYNAMIC

Allows dynamic typing.

private final boolean
dynamic

true if dynamic typing is a legitimate choice.

public static final Assigner.Typing
STATIC

Requires static typing.

Constructor Summary

AccessConstructor and Description
private
Typing(boolean
true if dynamic typing is a legitimate choice.
dynamic
)

Creates a new typing hint.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if dynamic typing is a legitimate choice.
isDynamic
()

Checks if this instance's typing behavior permits dynamic typing.

public static Assigner.Typing

Returns:

A corresponding typing constant.
of
(boolean
An indicator for if dynamic typing is a legitimate choice.
dynamic
)

Resolves a typing constant for the presented boolean where true indicates that dynamic typing is a legitimate choice.

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

Field Detail

DYNAMICback to summary
public static final Assigner.Typing DYNAMIC

Allows dynamic typing.

dynamicback to summary
private final boolean dynamic

true if dynamic typing is a legitimate choice.

STATICback to summary
public static final Assigner.Typing STATIC

Requires static typing.

Constructor Detail

Typingback to summary
private Typing(boolean dynamic)

Creates a new typing hint.

Parameters
dynamic:boolean

true if dynamic typing is a legitimate choice.

Method Detail

isDynamicback to summary
public boolean isDynamic()

Checks if this instance's typing behavior permits dynamic typing.

Returns:boolean

true if dynamic typing is a legitimate choice.

ofback to summary
public static Assigner.Typing of(boolean dynamic)

Resolves a typing constant for the presented boolean where true indicates that dynamic typing is a legitimate choice.

Parameters
dynamic:boolean

An indicator for if dynamic typing is a legitimate choice.

Returns:Assigner.Typing

A corresponding typing constant.

valueOfback to summary
public static Assigner.Typing valueOf(String name)
valuesback to summary
public static Assigner.Typing[] values()