| Modifier and Type | Method and Description |
|---|---|
static <A,B> Option<B> |
ap(Option<A> oa,
Option<Function<A,B>> of)
Applies an option of A to an option of a function with input type A and
result type B and return an option of B.
|
static <A> Iterable<Option<A>> |
filterNone(Iterable<Option<A>> options)
Filter out undefined options.
|
static <A> Option<A> |
find(Iterable<Option<A>> options)
Find the first option that
isDefined, or if there aren't any, then none. |
static <A> Iterable<A> |
flatten(Iterable<Option<A>> options)
|
static <A,B> Function<Function<A,B>,Function<Option<A>,Option<B>>> |
lift()
Returns a function that will lift a function that takes an A and returns a
B into a function that takes an option of A and returns an option of B.
|
static <A,B> Function<Option<A>,Option<B>> |
lift(Function<A,B> f)
Lifts a function that takes an A and returns a B into a function that takes
an option of A and returns an option of B.
|
static <A> Predicate<Option<A>> |
lift(Predicate<? super A> pred)
Lifts a predicate that takes an A into a predicate that takes an option of
A.
|
static <A,B,C> Function<BiFunction<A,B,C>,BiFunction<Option<A>,Option<B>,Option<C>>> |
lift2()
Returns a function that will lift a function that takes an A and a B and
returns a C into a function that takes an option of A and an option of B
and returns an option of C.
|
static <A,B,C> BiFunction<Option<A>,Option<B>,Option<C>> |
lift2(BiFunction<A,B,C> f2)
Lifts a function that takes an A and a B and returns a C into a function
that takes an option of A and an option of B and returns an option of C.
|
static <A,B> Function<A,Option<B>> |
nullSafe(Function<A,B> nullProducing)
Turn a null producing function into one that returns an option instead.
|
static <A> Function<A,Option<A>> |
toOption()
Function for wrapping values in a Some or None.
|
static <AA,A extends AA> |
upcast(Option<A> o)
Upcasts an
option of type A to an option of its super type
AA. |
public static <A> Option<A> find(Iterable<Option<A>> options)
isDefined, or if there aren't any, then none.A - the contained typeoptions - an Iterable of options to search throughpublic static <AA,A extends AA> Option<AA> upcast(Option<A> o)
option of type A to an option of its super type
AA.AA - the super type of the contained typeA - a A object.o - the source optionpublic static <A,B> Function<Option<A>,Option<B>> lift(Function<A,B> f)
A - the input type of the original functionB - the result type of the original functionf - the original function to be lifted, must not be nullpublic static <A,B> Function<Function<A,B>,Function<Option<A>,Option<B>>> lift()
A - the input type of the function that can be liftedB - the result type of the function that can be liftedpublic static <A> Predicate<Option<A>> lift(Predicate<? super A> pred)
A - the input type of the predicatepred - the original predicate to be lifted, must not be nullpublic static <A,B> Option<B> ap(Option<A> oa, Option<Function<A,B>> of)
A - the input type of the function wrapped in the option 'of'B - the result type of the function wrapped in the option 'of'oa - an option of the argument to the functionof - an option of a function that takes an A and returns a Bpublic static <A,B,C> BiFunction<Option<A>,Option<B>,Option<C>> lift2(BiFunction<A,B,C> f2)
A - the input type of the first argument of the original functionB - the input type of the second argument of the original functionC - the result type of the original functionf2 - the original function to be liftedpublic static <A,B,C> Function<BiFunction<A,B,C>,BiFunction<Option<A>,Option<B>,Option<C>>> lift2()
A - the input type of the first argument of the function that can be
liftedB - the input type of the second argument of the function that can
be liftedC - the result type of the function that can be liftedpublic static <A> Iterable<Option<A>> filterNone(Iterable<Option<A>> options)
A - the contained typeoptions - many options that may or may not be definedpublic static <A> Iterable<A> flatten(Iterable<Option<A>> options)
A - the contained typeoptions - the iterable of optionsIterable of the contained typepublic static <A> Function<A,Option<A>> toOption()
A - the contained typeFunction to wrap valuespublic static <A,B> Function<A,Option<B>> nullSafe(Function<A,B> nullProducing)
A - input type to the function.B - output type of the function.nullProducing - the function that may return nullCopyright © 2017 Atlassian. All rights reserved.