SetIf

data class SetIf(val value: Double?, val predicate: (Double?) -> Boolean = { true }) : ScoreTransformOp

Sets the score to a constant value if it matches a predicate.

Constructors

Link copied to clipboard
constructor(value: Double?, predicate: (Double?) -> Boolean = { true })

Properties

Link copied to clipboard

Predicate method to match against.

Link copied to clipboard

Value to set the score to if the predicate is matched.

Functions

Link copied to clipboard
open fun <V : Any> andThen(p0: Function<in Double?, out V>): Function<Double?, V>
Link copied to clipboard
open override fun apply(input: Double?): Double?
Link copied to clipboard
open fun <V : Any> compose(p0: Function<in V, out Double?>): Function<V, Double?>
Link copied to clipboard
open operator override fun invoke(input: Double?): Double?

Transforms the input score to value if predicate is matched; otherwise the original value is preserved.