doc / ch.tutteli.atrium.logic.creating.transformers.impl / BaseTransformationExecutionStep

BaseTransformationExecutionStep

abstract class BaseTransformationExecutionStep<T, R, E : Expect<R>> : TransformationExecutionStep<T, R, E> (source)

Step which has all necessary information to perform a subject transformation (subject change/feature extraction etc.) and now allows to decide how it should be done, especially regarding potential sub-assertions which should be applied to the new resulting subject.

Parameters

T - The parameter type of the current Expect, of its subject respectively.

R - The parameter type of the new Expect, of its subject respectively.

Constructors

<init>

BaseTransformationExecutionStep(container: AssertionContainer<T>, action: AssertionContainer<T>.() -> E, actionAndApply: AssertionContainer<T>.(Expect<R>.() -> Unit) -> Expect<R>)

Step which has all necessary information to perform a subject transformation (subject change/feature extraction etc.) and now allows to decide how it should be done, especially regarding potential sub-assertions which should be applied to the new resulting subject.

Properties

action

val action: AssertionContainer<T>.() -> E

An action such as transform, extract etc. which creates and returns a new Expect of type R.

actionAndApply

val actionAndApply: AssertionContainer<T>.(Expect<R>.() -> Unit) -> Expect<R>

An action such as transform, extract etc. which not only creates and returns a new Expect of type R but also applies a given assertionCreator lambda.

container

val container: AssertionContainer<T>

Expect which was involved in the building process and holds assertion for the initial subject.

Functions

collect

fun collect(assertionCreator: Expect<R>.() -> Unit): Assertion

Finishes the transformation process by collecting the assertions the given assertionCreator creates for the subject of type R resulting from the transformation and returns the assertions as a single Assertion.

collectAndAppend

fun collectAndAppend(assertionCreator: Expect<R>.() -> Unit): Expect<T>

Finishes the transformation process by appending the Assertion which is returned when calling collect with the given assertionCreator.

transform

fun transform(): E

Finishes the transformation process by simply performing the transformation as such.

transformAndAppend

fun transformAndAppend(assertionCreator: Expect<R>.() -> Unit): Expect<R>

Finishes the transformation process by carrying the transformation out and appending the assertions the given assertionCreator creates for the subject of type R resulting from the transformation as single assertion.

Extension Functions

collectAndLogicAppend

fun <T, R> TransformationExecutionStep<T, R, *>.collectAndLogicAppend(assertionCreator: AssertionContainer<R>.() -> Assertion): Expect<T>

Finishes the transformation process by appending the Assertion which is returned when calling TransformationExecutionStep.collectAndAppend with _logicAppend and the given assertionCreator.

Inheritors

ExecutionStepImpl

class ExecutionStepImpl<T, R> : FeatureExtractorBuilder.ExecutionStep<T, R>, BaseTransformationExecutionStep<T, R, FeatureExpect<T, R>>

ExecutionStepImpl

class ExecutionStepImpl<T, R> : SubjectChangerBuilder.ExecutionStep<T, R>, BaseTransformationExecutionStep<T, R, Expect<R>>