public final class And extends Object implements Scalar<Boolean>
This class could be also used for matching multiple boolean expressions:
new And(
new True(),
new True(),
new True()
).value(); // the result is true
new And(
new True(),
new False(),
new True()
).value(); // the result is false
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.
There is no thread-safety guarantee.
Constructor and Description |
---|
And(Func<X,Boolean> func,
Iterable<X> src)
Ctor.
|
And(Func<X,Boolean> func,
X... src)
Ctor.
|
And(Iterable<Scalar<Boolean>> iterable)
Ctor.
|
And(Scalar<Boolean>... scalar)
Ctor.
|
And(X subject,
Func<X,Boolean>... conditions)
Ctor.
|
And(X subject,
Iterable<Func<X,Boolean>> conditions)
Ctor.
|
@SafeVarargs public And(Func<X,Boolean> func, X... src)
X
- Type of items in the iterablefunc
- Func to mapsrc
- The iterablepublic And(Func<X,Boolean> func, Iterable<X> src)
X
- Type of items in the iterablefunc
- Func to mapsrc
- The iterable@SafeVarargs public And(X subject, Func<X,Boolean>... conditions)
X
- Type of items in the iterablesubject
- The subjectconditions
- Funcs to mappublic And(X subject, Iterable<Func<X,Boolean>> conditions)
X
- Type of items in the iterablesubject
- The subjectconditions
- Funcs to map@SafeVarargs public And(Scalar<Boolean>... scalar)
scalar
- The Scalar.Copyright © 2017–2021 Cactoos. All rights reserved.