fj.function.Visitor Maven / Gradle / Ivy
package fj.function;
import fj.Equal;
import fj.F;
import fj.F0;
import fj.F2;
import fj.Function;
import fj.Monoid;
import fj.P1;
import fj.P2;
import fj.data.List;
import fj.data.Option;
import static fj.Function.compose;
import static fj.Function.curry;
import static fj.data.List.lookup;
/**
* The essence of the visitor design pattern expressed polymorphically.
*
* @version %build.number%
*/
public final class Visitor {
private Visitor() {
throw new UnsupportedOperationException();
}
/**
* Returns the first value available in the given list of optional values. If none is found return the given default value.
*
* @param values The optional values to search.
* @param def The default value if no value is found in the list.
* @return The first value available in the given list of optional values. If none is found return the given default value.
*/
public static X findFirst(final List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy