Class RowSimulator

  • All Implemented Interfaces:
    rocks.frieler.kraftsql.testing.engine.ExpressionSimulator

    
    public class RowSimulator<E extends Engine<E>>
     implements ExpressionSimulator<E, DataRow, Row<E, DataRow>>
                        

    Simulator for a Row expression.

    In a simulation, the Row expression always returns a DataRow. The mapping to another Kotlin class is done by the SimulatorORMapping.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final KClass<out Row<E, DataRow>> expression
    • Constructor Summary

      Constructors 
      Constructor Description
      RowSimulator()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      KClass<out Row<E, DataRow>> getExpression()
      Function1<DataRow, DataRow> simulateExpression(Row<E, DataRow> expression) Provides a Kotlin simulation of the given Expression to be applied to a DataRow.
      Function1<List<DataRow>, DataRow> simulateAggregation(Row<E, DataRow> expression) Provides a Kotlin simulation of the given Expression as an aggregation to be applied to multiple DataRows.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RowSimulator

        RowSimulator()
    • Method Detail

      • simulateExpression

         Function1<DataRow, DataRow> simulateExpression(Row<E, DataRow> 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>, DataRow> simulateAggregation(Row<E, DataRow> 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 groupExpressions or the same must apply to all its sub-expressions.

        Returns:

        a function that simulates the Expression