T
- Type of item.public final class Ternary<T> extends ScalarEnvelope<T>
There is no thread-safety guarantee.
This class implements Scalar
, which throws a checked
Exception
. This may not be convenient in many cases. To make
it more convenient and get rid of the checked exception you can
use the Unchecked
decorator. Or you may use
IoChecked
to wrap it in an IOException.
new Ternary<>(
scalar,
value -> value > 3,
value -> true,
value -> false
).value() // will be equal to true
Constructor and Description |
---|
Ternary(boolean cnd,
Scalar<? extends T> cons,
Scalar<? extends T> alter)
Ctor.
|
Ternary(boolean cnd,
T cons,
T alter)
Ctor.
|
Ternary(Scalar<? extends X> input,
Func<? super X,Boolean> cnd,
Func<? super X,? extends T> cons,
Func<? super X,? extends T> alter)
Ctor.
|
Ternary(Scalar<Boolean> cnd,
Scalar<? extends T> cons,
Scalar<? extends T> alter)
Ctor.
|
Ternary(Scalar<Boolean> cnd,
T cons,
T alter)
Ctor.
|
Ternary(X input,
Func<? super X,Boolean> cnd,
Func<? super X,? extends T> cons,
Func<? super X,? extends T> alter)
Ctor.
|
public Ternary(boolean cnd, T cons, T alter)
cnd
- The conditioncons
- The consequentalter
- The alternativepublic Ternary(Scalar<Boolean> cnd, T cons, T alter)
cnd
- The conditioncons
- The consequentalter
- The alternativepublic Ternary(boolean cnd, Scalar<? extends T> cons, Scalar<? extends T> alter)
cnd
- The conditioncons
- The consequentalter
- The alternativepublic Ternary(Scalar<Boolean> cnd, Scalar<? extends T> cons, Scalar<? extends T> alter)
cnd
- The conditioncons
- The consequentalter
- The alternativepublic Ternary(X input, Func<? super X,Boolean> cnd, Func<? super X,? extends T> cons, Func<? super X,? extends T> alter)
X
- Type of inputinput
- The input to pass to all of themcnd
- The conditioncons
- The consequentalter
- The alternativepublic Ternary(Scalar<? extends X> input, Func<? super X,Boolean> cnd, Func<? super X,? extends T> cons, Func<? super X,? extends T> alter)
X
- Type of inputinput
- The input to pass to all of themcnd
- The conditioncons
- The consequentalter
- The alternativeCopyright © 2017–2022 Cactoos. All rights reserved.