Interface OMFunction<T,R,E extends Exception>

Type Parameters:
T - 입력 type
R - 결과 type
E - 던질 수 있는 exception type
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface OMFunction<T,R,E extends Exception>
checked exception 을 던질 수 있는 Function.

https://www.oreilly.com/content/handling-checked-exceptions-in-java-streams/

  • Method Details

    • apply

      R apply(T t) throws E
      DOCUMENT ME!
      Parameters:
      t - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      E - DOCUMENT ME!
    • functionWrapper

      static <T, R, E extends Exception> Function<T,R> functionWrapper(OMFunction<T,R,E> function)
      OMFunction 을 Function 으로 감싼다. 발생한 예외는 RuntimeException 으로 감싸서 던진다.
      Type Parameters:
      T - 입력 type
      R - 결과 type
      E - 던질 수 있는 exception type
      Parameters:
      function - 감쌀 function
      Returns:
      Function