Kactoos

kactoos-jvm / nnl.rocks.kactoos.scalar / Ternary

Ternary

class Ternary<T : Any> : Scalar<T>

Ternary operation.

There is no thread-safety guarantee.

Parameters

T - Type of item.

condition - The condition

consequent - The consequent

alternative - The alternative

Since 0.4

Constructors

Name Summary
<init> Ternary(cnd: Boolean, cons: T, alter: T)
Ternary(cnd: KScalar<Boolean>, cons: T, alter: T)Ternary(condition: KScalar<Boolean>, consequent: KScalar<T>, alternative: KScalar<T>)
Ternary operation.

Functions

Name Summary
invoke fun invoke(): T
Get value of this Scalar

Companion Object Functions

Name Summary
invoke operator fun <T : Any, X : Any> invoke(input: X, cnd: Func<X, Boolean>, cons: Func<X, T>, alter: Func<X, T>): Ternary<T>