![JAR search and dependency download from the Maven repository](/logo.png)
org.davidmoten.kool.function.Function Maven / Gradle / Ivy
package org.davidmoten.kool.function;
import org.davidmoten.kool.internal.util.Exceptions;
import org.davidmoten.kool.internal.util.StreamUtils;
@FunctionalInterface
public interface Function {
R apply(T t) throws Exception;
default R applyUnchecked(T t) {
try {
return apply(t);
} catch (Exception e) {
return Exceptions.rethrow(e);
}
}
@SuppressWarnings("unchecked")
static Function identity() {
return (Function) StreamUtils.FunctionIdentityHolder.IDENTITY;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy