public interface Assigner
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.
Modifier and Type | Interface and Description |
---|---|
static class |
Assigner.EqualTypesOnly
An assigner that only allows to assign types if they are equal to another.
|
static class |
Assigner.Refusing
An assigner that does not allow any assignments.
|
static class |
Assigner.Typing
Indicates for a type assignment, if a type casting should be applied in case that two types are not statically assignable.
|
Modifier and Type | Field and Description |
---|---|
static Assigner |
DEFAULT
A default assigner that can handle
void , primitive types and reference types which considers generic types as raw types. |
static Assigner |
GENERICS_AWARE
A generics-aware assigner that can handle
void , primitive types which reference types. |
Modifier and Type | Method and Description |
---|---|
StackManipulation |
assign(TypeDescription.Generic source,
TypeDescription.Generic target,
Assigner.Typing typing) |
static final Assigner DEFAULT
void
, primitive types and reference types which considers generic types as raw types.static final Assigner GENERICS_AWARE
void
, primitive types which reference types.StackManipulation assign(TypeDescription.Generic source, TypeDescription.Generic target, Assigner.Typing typing)
source
- The original type that is to be transformed into the targetType
.target
- The target type into which the sourceType
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 that void
to non-void
assignments are permitted.sourceType
into the targetType
if this
is possible. An illegal stack manipulation otherwise.Copyright © 2014–2020. All rights reserved.