castTo
Casts this into the stage result type of outClazz.
Note that the conversion constraints are different from the matrix stated in StageResult. In general:
outClazz == DontCare::class
: Returns DontCareoutClazz == Undefined::class
: Returns UndefinedoutClazz == StageResult.Any::class
: Returnsthis
converted by StageResult.asAnyResultoutClazz == this::class
: Returns this
All other conversions are invalid and throws IllegalArgumentException.