Class ArraySimulator
-
- All Implemented Interfaces:
-
rocks.frieler.kraftsql.testing.engine.ExpressionSimulator
public final class ArraySimulator<E extends Engine<E>, T extends Object> implements ExpressionSimulator<E, Array<T>, Array<E, T>>
Simulator for Array expressions.
-
-
Field Summary
Fields Modifier and Type Field Description private final KClass<out Array<E, T>>expression
-
Constructor Summary
Constructors Constructor Description ArraySimulator()
-
Method Summary
Modifier and Type Method Description KClass<out Array<E, T>>getExpression()Function1<DataRow, Array<T>>simulateExpression(Array<E, T> expression)Provides a Kotlin simulation of the given Expression to be applied to a DataRow. Function1<List<DataRow>, Array<T>>simulateAggregation(Array<E, T> expression)Provides a Kotlin simulation of the given Expression as an aggregation to be applied to multiple DataRows. -
-
Method Detail
-
getExpression
KClass<out Array<E, T>> getExpression()
-
simulateExpression
Function1<DataRow, Array<T>> simulateExpression(Array<E, T> expression)
Provides a Kotlin simulation of the given Expression to be applied to a DataRow.
- Returns:
a function that simulates the Expression
-
simulateAggregation
Function1<List<DataRow>, Array<T>> simulateAggregation(Array<E, T> expression)
Provides a Kotlin simulation of the given Expression as an aggregation to be applied to multiple DataRows.
For the Expression to aggregate multiple DataRows, it must either be an rocks.frieler.kraftsql.expressions.Aggregation, one of the
groupExpressionsor the same must apply to all its sub-expressions.- Returns:
a function that simulates the Expression
-
-
-
-