doc / ch.tutteli.atrium.domain.creating.any.typetransformation / AnyTypeTransformation / Creator / create

create

abstract fun create(parameterObject: ParameterObject<S, T>, canBeTransformed: (S) -> Boolean, transform: (S) -> T, failureHandler: FailureHandler<S, T>): Unit (source)

Creates the type transformation Assertion and ads it to the given ParameterObject.subjectPlant and delegates to the given failureHandler if the transformation fails.

Parameters

parameterObject - The ParameterObject containing inter alia ParameterObject.assertionCreator to create subsequent assertions.

canBeTransformed - Defines whether the subject of the given ParameterObject.subjectPlant (with type S) can be transformed to the target type T.

transform - The transformation function as such.

failureHandler - The failure handler which is called if the transformation cannot be executed