com.twitter.common.base
Class ExceptionalFunctions

java.lang.Object
  extended by com.twitter.common.base.ExceptionalFunctions

public final class ExceptionalFunctions
extends Object

Utility functions for working with exceptional functions.


Method Summary
static
<T,E extends Exception>
ExceptionalFunction<T,T,E>
compose(ExceptionalFunction<T,T,E> function, ExceptionalFunction<T,T,E>... functions)
          Returns a List of ExceptionalFunctions from variable number of ExceptionalFunctions.
static
<T,E extends Exception>
ExceptionalFunction<T,T,E>
compose(Iterable<ExceptionalFunction<T,T,E>> functions)
          Returns an ExceptionalFunction that is a composition of multiple ExceptionalFunctions.
static
<S,T,E extends Exception>
CallableExceptionalSupplier<T,E>
curry(ExceptionalFunction<S,T,E> function, S argument)
          Returns an ExceptionalSupplier/Callable object that will return the result of function applied to argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

curry

public static <S,T,E extends Exception> CallableExceptionalSupplier<T,E> curry(ExceptionalFunction<S,T,E> function,
                                                                               S argument)
Returns an ExceptionalSupplier/Callable object that will return the result of function applied to argument. Evaluation is lazy and un-memoized.


compose

public static <T,E extends Exception> ExceptionalFunction<T,T,E> compose(Iterable<ExceptionalFunction<T,T,E>> functions)
Returns an ExceptionalFunction that is a composition of multiple ExceptionalFunctions.


compose

public static <T,E extends Exception> ExceptionalFunction<T,T,E> compose(ExceptionalFunction<T,T,E> function,
                                                                         ExceptionalFunction<T,T,E>... functions)
Returns a List of ExceptionalFunctions from variable number of ExceptionalFunctions.