interface IDownCastBuilder<T : Any, TSub : T>
A builder for creating a down-casting IAssertion.
Or in other words, helps to make an assertion about IAssertionPlant.subject of type T that it can be down-casted to TSub.
T
- The type of IAssertionPlant.subject.
TSub
- The type to which IAssertionPlant.subject can be down-casted, hence needs to be a subtype of T.
abstract fun cast(): IAssertionPlant<TSub>
Performs the down-cast if possible; reports a failure otherwise. |
|
abstract fun withLazyAssertions(createAssertions: IAssertionPlant<TSub>.() -> Unit): IDownCastBuilder<T, TSub>
Use this method if you want to add several assertions which are checked lazily after the down cast is performed. |
|
abstract fun withNullRepresentation(representation: String): IDownCastBuilder<T, TSub> abstract fun withNullRepresentation(translatableRepresentation: ITranslatable): IDownCastBuilder<T, TSub>
Use this method if you want to use your own |