Package au.csiro.pathling.utilities
Interface Functions
public interface Functions
Utility class containing some functional programming helper functions.
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionbackCurried(BiFunction<A1, A2, R> f) Converts a function that takes two arguments to its curried version with reversed arguments.curried(BiFunction<A1, A2, R> f) Converts a function that takes two arguments to its curried version.Returns function that conditionally casts an object to a given class, returning an empty optional if the cast fails.
-
Method Details
-
curried
Converts a function that takes two arguments to its curried version.- Type Parameters:
A1- the first argument typeA2- the second argument typeR- the return type- Parameters:
f- the function to be curried- Returns:
- the curried function
-
backCurried
Converts a function that takes two arguments to its curried version with reversed arguments.- Type Parameters:
A1- the first argument typeA2- the second argument typeR- the return type- Parameters:
f- the function to be curried- Returns:
- the curried function
-
maybeCast
Returns function that conditionally casts an object to a given class, returning an empty optional if the cast fails.- Type Parameters:
T- the class to cast to- Parameters:
clazz- the class to cast to- Returns:
- the function
-