public interface ICallContractor
This contractor is to make a sure a check-call that asserts is followed up by a matching fail-call.
Implementations of this should be extensible (not final).
Modifier and Type | Method and Description |
---|---|
ICallContract |
getContractWithCaller(Object caller)
Retrieves a reference to a {link:ICallContract} previously pushed by caller.
|
ICallContract |
popContractWithCaller(Object caller,
IFailer throwingFailer,
Class<? extends IFail> failSpecification)
Ends a {link:ICallContract} between caller and call contractor.
|
void |
pushContractWithCaller(ICallContract callContract)
Starts a {link:ICallContract} between caller and call contractor.
|
void pushContractWithCaller(ICallContract callContract)
Argument checkSpecification is annotated with a matching fail specification that needs to be employed by the caller to end the contract.
callContract
- contract data created by asserting check-method.IllegalArgumentException
- if any contract data is missingIllegalStateException
- if a previous push (per thread) has not been poppedICallContract popContractWithCaller(Object caller, IFailer throwingFailer, Class<? extends IFail> failSpecification)
Argument failSpecification is annotated with a matching check specification that was employed by the caller to start the contract.
caller
- instance that called a checker and needs to call a failerthrowingFailer
- failer that was called to throw an exceptionfailSpecification
- fail specification type inhering by IFailIllegalArgumentException
- if any of the arguments are nullIllegalStateException
- if a previous push (per thread) is missingICallContract getContractWithCaller(Object caller)
caller
- instance that called a checker and needs to call a failerThe MIT License (MIT) - Copyright © 2014-2015 Keld Oelykke. All Rights Reserved.