class DownCaster<T : Any, TSub : T>
(source)Helps to make an assertion about the BaseAssertionPlant.subject, that it is of type T and can be down-casted to type TSub.
T
- The type of BaseAssertionPlant.subject.
TSub
- The type to which BaseAssertionPlant.subject can be down-casted, hence needs to be a subtype of T.
DownCaster(failureHandler: AnyTypeTransformation.TypeTransformationFailureHandler<T, TSub>)
Helps to make an assertion about the BaseAssertionPlant.subject, that it is of type T and can be down-casted to type TSub. |
fun
Performs the down-cast and applies the given assertionCreator to the down-casted subject of subjectPlant if successful or passes it to a AnyTypeTransformation.TypeTransformationFailureHandler otherwise. |