public interface ICallContract
The data is everything needed for the fail-method to throw an exception with an informative well-formatted error message.
Please note! ALL properties not named "OrNull" MUST be supplied (cannot be null).
Implementations of this should be extensible (not final).
Modifier and Type | Method and Description |
---|---|
IChecker |
getAssertingChecker()
The checker with asserting check-method.
|
Object |
getCaller()
The caller that called asserting check-method and therefore must call fail-method.
|
Object[] |
getCheckArguments()
The arguments supplied the asserting check-method by the caller.
|
Object[] |
getCheckExtraArguments()
The extra arguments supplied by the asserting check-method implementation.
|
Class<? extends ICheck> |
getCheckSpecification()
The check specification (interface) with specification of asserting check-method.
|
Class<? extends IFail> |
reflectFailSpecificationType()
Reflects the fail specification (interface) that should be used to end this contract.
|
void |
setAssertingChecker(IChecker assertingChecker)
The checker with asserting check-method.
|
void |
setCaller(Object caller)
The caller that called asserting check-method and therefore must call fail-method.
|
void |
setCheckArguments(Object[] checkArguments)
The arguments supplied the asserting check-method by the caller.
|
void |
setCheckExtraArguments(Object[] checkExtraArguments)
The extra arguments supplied by the asserting check-method implementation.
|
void |
setCheckSpecification(Class<? extends ICheck> checkSpecification)
The check specification (interface) with specification of asserting check-method.
|
void |
validateContractData()
Validates the contract data e.g.
|
Object getCaller()
void setCaller(Object caller)
caller
- caller that called asserting check-method and therefore must call fail-methodIChecker getAssertingChecker()
void setAssertingChecker(IChecker assertingChecker)
assertingChecker
- checker with asserting check-methodClass<? extends ICheck> getCheckSpecification()
The checkSpecification is annotated with a fail specification that needs to be called by the caller to end this contract.
void setCheckSpecification(Class<? extends ICheck> checkSpecification)
The checkSpecification is annotated with a fail specification that needs to be called by the caller to end this contract.
checkSpecification
- check specification (interface) with specification of asserting check-methodObject[] getCheckArguments()
void setCheckArguments(Object[] checkArguments)
checkArguments
- arguments supplied the asserting check-method by the callerObject[] getCheckExtraArguments()
void setCheckExtraArguments(Object[] checkExtraArguments)
checkExtraArguments
- extra arguments supplied by the asserting check-method implementationvoid validateContractData()
IllegalArgumentException
- if any contract data is missingThe MIT License (MIT) - Copyright © 2014-2015 Keld Oelykke. All Rights Reserved.