com.twitter.common.base
Interface ExceptionalFunction<S,T,E extends Exception>

Type Parameters:
S - The argument type for the function.
T - The return type for the function.
E - The exception type that the function throws.
All Known Subinterfaces:
Function<S,T>

public interface ExceptionalFunction<S,T,E extends Exception>

An interface that captures a unit of work against an item.


Method Summary
 T apply(S item)
          Performs a unit of work on item, possibly throwing E in the process.
 

Method Detail

apply

T apply(S item)
        throws E extends Exception
Performs a unit of work on item, possibly throwing E in the process.

TODO(John Sirois): consider supporting @Nullable

Parameters:
item - The item to perform work against.
Returns:
The result of the computation.
Throws:
E - if there was a problem performing the work.
E extends Exception