class DownCaster<T : Any, TSub : T>
Helps to make an assertion about the IBaseAssertionPlant.subject, that it is of type T and can be down-casted to type TSub.
T
- The type of IBaseAssertionPlant.subject.
TSub
- The type to which IBaseAssertionPlant.subject can be down-casted, hence needs to be a subtype of T.
DownCaster(failureHandler: IDownCastFailureHandler<T, TSub>)
Helps to make an assertion about the IBaseAssertionPlant.subject, that it is of type T and can be down-casted to type TSub. |
fun downCast(description: ITranslatable, subType: KClass<TSub>, subjectPlant: IBaseAssertionPlant<T?, *>, assertionCreator: IAssertionPlant<TSub>.() -> Unit): Unit
Performs the down-cast and applies the given assertionCreator to the down-casted subject of subjectPlant if successful or passes it to the failureHandler otherwise. |