invoke

operator fun <T, R, PO : SubjectBasedOption.DefinedOption<T, R, *>> invoke(expect: Expect<T>, subStep: PO.() -> Pair<() -> R, (T) -> R>, definedOptionFactory: () -> PO): R(source)

Setups the SubjectBasedOption contract where the given expect, it's AssertionContainer.maybeSubject respectively, is used to determine if the resulting ifAbsent or ifDefined option is called where the definedOptionFactory initialises the builder (pattern) and the subStep then allows to define the ifDefined and ifAbsent steps.

Return

In the end returns the result of either ifDefined or ifAbsent which subStep defines.