Package org.opencastproject.util.data
Class Function<A,B>
java.lang.Object
org.opencastproject.util.data.Function<A,B>
- Direct Known Subclasses:
Effect,Function.X,Predicate
Function of arity 1.
A general note on function implementations: Each function has an associated X version with the only difference that a
checked exception may be thrown on application. This behaviour could be nicely combined into the main function class
but with the cost of having no abstract method. Some IDEs such as IntelliJ support nice code folding for SAM (single
abstract method) classes.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFunction.X<A,B> Version ofFunctionthat allows for throwing a checked exception. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Function
public Function()
-
-
Method Details
-
apply
Apply function toa. -
curry
Currying. -
curry
Currying. -
o
Function composition.g.o(f).apply(x) == g(f(x)) -
o
Function composition.g.o(f).apply() == g(f()) -
then
Left to right composition:f then g = g(f(x)) -
rethrow
- See Also:
-
handle
- See Also:
-
either
- See Also:
-
toEffect
Turn this function into an effect by discarding its result. -
toFn
-