[Solved] How can I change one function value in a boolean-valued java Function?

[ad_1]

Maybe what you actually want is to use a Predicate?

Predicate<Integer> crazyFunction = x -> false;
for (Integer thisInteger : listOfIntegers) {
    crazyFunction = crazyFunction.or(Predicate.isEqual(thisInteger));
}

// Is a given integer one of our integers?
boolean isGoodInteger = crazyFunction.apply(42);

2

[ad_2]

solved How can I change one function value in a boolean-valued java Function?