AnyInputHandler

internal class AnyInputHandler<in Value : Any, out Return>(val valueTypeIfEmpty: KType = nothingType) : AggregatorInputHandler<Value, Return>

Input handler for aggregators that can handle any type of input.

When calculating the value type, it will try to find the common type in terms of inheritance.

Constructors

Link copied to clipboard
constructor(valueTypeIfEmpty: KType = nothingType)

Properties

Link copied to clipboard
open override var aggregator: Aggregator<Value, Return>?

Reference to the aggregator instance.

Link copied to clipboard
open override val valueTypeIfEmpty: KType

The type of the value if the input is empty.

Functions

Link copied to clipboard
open override fun calculateValueType(valueTypes: Set<KType>): ValueType

If the specific ValueType of the input is not known, but you still want to call aggregate, this function can be called to calculate it in terms of inheritance by combining the set of known valueTypes.

open override fun calculateValueType(values: Sequence<Value?>): ValueType

WARNING: HEAVY!

Link copied to clipboard
open fun init(aggregator: Aggregator<Value, Return>)
Link copied to clipboard
open override fun preprocessAggregation(values: Sequence<Value?>, valueType: ValueType): Pair<Sequence<Value?>, KType>

No preprocessing is done on the input values.