doc / ch.tutteli.atrium.domain.creating.any.typetransformation / AnyTypeTransformation / ParameterObject

ParameterObject

data class ParameterObject<out S : Any, in T : Any> (source)

A parameter object which contains all necessary information to report a failure

Parameters

description - Describes what assertion the type transformation represents, e.g. is a in case of a down cast.

representation - The representation of the expected result, e.g. Int::class in case of a down cast from Number to Int.

subjectPlant - The plant to which the assertion (including additional assertions created by assertionCreator) should be added.

assertionCreator - The lambda which can create subsequent assertions for the transformed AssertionPlant.subject in case the type transformation succeeds

warningTransformationFailed - Explains why the subjectPlant's subject could not be transformed to the desired type.

Constructors

<init>

ParameterObject(description: Translatable, representation: Any, subjectPlant: BaseAssertionPlant<S?, *>, assertionCreator: AssertionPlant<T>.() -> Unit, warningTransformationFailed: Translatable)

A parameter object which contains all necessary information to report a failure

Properties

assertionCreator

val assertionCreator: AssertionPlant<T>.() -> Unit

The lambda which can create subsequent assertions for the transformed AssertionPlant.subject in case the type transformation succeeds

description

val description: Translatable

Describes what assertion the type transformation represents, e.g. is a in case of a down cast.

representation

val representation: Any

The representation of the expected result, e.g. Int::class in case of a down cast from Number to Int.

subjectPlant

val subjectPlant: BaseAssertionPlant<S?, *>

The plant to which the assertion (including additional assertions created by assertionCreator) should be added.

warningTransformationFailed

val warningTransformationFailed: Translatable

Explains why the subjectPlant's subject could not be transformed to the desired type.