org.lambda.functions.Functions Maven / Gradle / Ivy
package org.lambda.functions;
import com.spun.util.ObjectUtils;
public class Functions
{
public static Function1 unchecked(Function1WithException function)
{
return i -> ObjectUtils.throwAsError(() -> function.call(i));
}
public static Function2 unchecked(Function2WithException function)
{
return (p1, p2) -> ObjectUtils.throwAsError(() -> function.call(p1, p2));
}
public static Function3 unchecked(
Function3WithException function)
{
return (p1, p2, p3) -> ObjectUtils.throwAsError(() -> function.call(p1, p2, p3));
}
public static Function4 unchecked(
Function4WithException function)
{
return (p1, p2, p3, p4) -> ObjectUtils.throwAsError(() -> function.call(p1, p2, p3, p4));
}
public static Function5 unchecked(
Function5WithException function)
{
return (p1, p2, p3, p4, p5) -> ObjectUtils.throwAsError(() -> function.call(p1, p2, p3, p4, p5));
}
public static Function6 unchecked(
Function6WithException function)
{
return (p1, p2, p3, p4, p5, p6) -> ObjectUtils.throwAsError(() -> function.call(p1, p2, p3, p4, p5, p6));
}
public static Function7 unchecked(
Function7WithException function)
{
return (p1, p2, p3, p4, p5, p6, p7) -> ObjectUtils
.throwAsError(() -> function.call(p1, p2, p3, p4, p5, p6, p7));
}
public static Function8 unchecked(
Function8WithException function)
{
return (p1, p2, p3, p4, p5, p6, p7, p8) -> ObjectUtils
.throwAsError(() -> function.call(p1, p2, p3, p4, p5, p6, p7, p8));
}
public static Function9 unchecked(
Function9WithException function)
{
return (p1, p2, p3, p4, p5, p6, p7, p8, p9) -> ObjectUtils
.throwAsError(() -> function.call(p1, p2, p3, p4, p5, p6, p7, p8, p9));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy