au.csiro.sparkle.common.ThrowingFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of variant-spark_2.11 Show documentation
Show all versions of variant-spark_2.11 Show documentation
Genomic variants interpretation toolkit
The newest version!
package au.csiro.sparkle.common;
import java.util.function.Function;
public abstract class ThrowingFunction {
public abstract R apply(T t) throws Exception;
public static Function rethrow(final ThrowingFunction c) {
return t -> {
try {
return c.apply(t);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
};
}
}