All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lambda.actions.Actions Maven / Gradle / Ivy

There is a newer version: 24.9.0
Show newest version
package org.lambda.actions;

import com.spun.util.ObjectUtils;

public class Actions
{
  public static  Action1 unchecked(Action1WithException action)
  {
    return i -> ObjectUtils.throwAsError(() -> action.call(i));
  }
  public static  Action2 unchecked(Action2WithException action)
  {
    return (p1, p2) -> ObjectUtils.throwAsError(() -> action.call(p1, p2));
  }
  public static  Action3 unchecked(Action3WithException action)
  {
    return (p1, p2, p3) -> ObjectUtils.throwAsError(() -> action.call(p1, p2, p3));
  }
  public static  Action4 unchecked(
      Action4WithException action)
  {
    return (p1, p2, p3, p4) -> ObjectUtils.throwAsError(() -> action.call(p1, p2, p3, p4));
  }
  public static  Action5 unchecked(
      Action5WithException action)
  {
    return (p1, p2, p3, p4, p5) -> ObjectUtils.throwAsError(() -> action.call(p1, p2, p3, p4, p5));
  }
  public static  Action6 unchecked(
      Action6WithException action)
  {
    return (p1, p2, p3, p4, p5, p6) -> ObjectUtils.throwAsError(() -> action.call(p1, p2, p3, p4, p5, p6));
  }
  public static  Action7 unchecked(
      Action7WithException action)
  {
    return (p1, p2, p3, p4, p5, p6, p7) -> ObjectUtils.throwAsError(() -> action.call(p1, p2, p3, p4, p5, p6, p7));
  }
  public static  Action8 unchecked(
      Action8WithException action)
  {
    return (p1, p2, p3, p4, p5, p6, p7, p8) -> ObjectUtils
        .throwAsError(() -> action.call(p1, p2, p3, p4, p5, p6, p7, p8));
  }
  public static  Action9 unchecked(
      Action9WithException action)
  {
    return (p1, p2, p3, p4, p5, p6, p7, p8, p9) -> ObjectUtils
        .throwAsError(() -> action.call(p1, p2, p3, p4, p5, p6, p7, p8, p9));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy