public class NoExpectation extends AbstractReturnAwareTypeExpectation
Constructor and Description |
---|
NoExpectation(AbstractTypeComputationState state,
boolean returnType) |
Modifier and Type | Method and Description |
---|---|
ITypeExpectation |
copyInto(ITypeReferenceOwner referenceOwner) |
LightweightTypeReference |
getExpectedType()
Returns the expected type.
|
boolean |
isNoTypeExpectation()
Returns
true if anything is allowed and no constraints are expected. |
boolean |
isVoidTypeAllowed()
Returns
true if Void.TYPE is a valid type. |
acceptActualType, isReturnType
acceptActualType, acceptActualType, createUnboundTypeReference, getReferenceOwner, getResolvedTypes, getState, isOwnedBy, toString
public NoExpectation(AbstractTypeComputationState state, boolean returnType)
public LightweightTypeReference getExpectedType()
ITypeExpectation
ITypeExpectation.getExpectedType()
may return
null
or some sort of unresolved, specialized reference. If null
is returned, clients
may want to check ITypeExpectation.isNoTypeExpectation()
or ITypeExpectation.isVoidTypeAllowed()
.null
.public boolean isNoTypeExpectation()
ITypeExpectation
true
if anything is allowed and no constraints are expected.true
if anything is allowed and no constraints are expected.public boolean isVoidTypeAllowed()
ITypeExpectation
true
if Void.TYPE
is a valid type. It may be the only valid type
or there may exist others.isVoidTypeAllowed
in interface ITypeExpectation
isVoidTypeAllowed
in class AbstractTypeExpectation
true
if primitive void
is allowed.public ITypeExpectation copyInto(ITypeReferenceOwner referenceOwner)