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

FailureHandler

interface FailureHandler<in S : Any, out T : Any> (source)

A handler which is responsible to create the Assertion of a failed type transformation.

It is also responsible to decide how the lambda -- which could have created subsequent assertions for the transformed AssertionPlant.subject if the transformation of the AssertionPlant.subject to type T did not fail -- should be used in reporting.

Parameters

S - The type of AssertionPlant.subject.

T - The target type to which AssertionPlant.subject should have been transformed to.

Functions

createAndAddAssertionToPlant

abstract fun createAndAddAssertionToPlant(parameterObject: ParameterObject<S, T>): Unit

Creates the failing assertion and adds it to the ParameterObject.subjectPlant.

createFailingAssertion

abstract fun createFailingAssertion(description: Translatable, representation: Any): Assertion

Creates the failing Assertion based on the given description and representation