@HashCodeAndEqualsPlugin.Enhance public class VoidAwareAssigner extends Object implements Assigner
void
type. This means:
void
type is assigned to the void
it will consider this a trivial operation.void
type is assigned to a non-void
type, it will pop the top value from the stack.void
type is assigned to a void
type, it will load the target type's default value
only if this was configured at the assigner's construction.void
types are subject of the assignment, it will delegate the assignment to its chained
assigner.Assigner.EqualTypesOnly, Assigner.Refusing, Assigner.Typing
DEFAULT, GENERICS_AWARE
Constructor and Description |
---|
VoidAwareAssigner(Assigner chained)
Creates a new assigner that is capable of handling void types.
|
Modifier and Type | Method and Description |
---|---|
StackManipulation |
assign(TypeDescription.Generic source,
TypeDescription.Generic target,
Assigner.Typing typing) |
public VoidAwareAssigner(Assigner chained)
chained
- A chained assigner which will be queried by this assigner to handle assignments that
do not involve a void
type.public StackManipulation assign(TypeDescription.Generic source, TypeDescription.Generic target, Assigner.Typing typing)
assign
in interface Assigner
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–2025. All rights reserved.