Package com.io7m.idstore.model
Class IdOptional
java.lang.Object
com.io7m.idstore.model.IdOptional
Extra functions for
Optional
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
IdOptional.IdPartialFunctionType<A,
B, E extends Exception> The type of partial functions. -
Method Summary
Modifier and TypeMethodDescriptionflatMapPartial
(Optional<A> o, IdOptional.IdPartialFunctionType<A, Optional<B>, E> f) mapPartial
(Optional<A> o, IdOptional.IdPartialFunctionType<A, B, E> f)
-
Method Details
-
mapPartial
public static <A,B, Optional<B> mapPartialE extends Exception> (Optional<A> o, IdOptional.IdPartialFunctionType<A, B, throws EE> f) - Type Parameters:
A
- The type of source valuesB
- The type of return valuesE
- The type of exceptions raised- Parameters:
o
- The optionalf
- The function- Returns:
- The value of
f
- Throws:
E
- On errors
-
flatMapPartial
public static <A,B, Optional<B> flatMapPartialE extends Exception> (Optional<A> o, IdOptional.IdPartialFunctionType<A, Optional<B>, throws EE> f) - Type Parameters:
A
- The type of source valuesB
- The type of return valuesE
- The type of exceptions raised- Parameters:
o
- The optionalf
- The function- Returns:
- The value of
f
- Throws:
E
- On errors
-