T - The type of values.@EqualityStructural public interface OptionType<T> extends Serializable
The type of optional values.
| Modifier and Type | Method and Description |
|---|---|
<U> U |
accept(OptionVisitorType<T,U> v)
Accept a visitor.
|
<U,E extends Throwable> |
acceptPartial(OptionPartialVisitorType<T,U,E> v)
Accept a partial visitor.
|
boolean |
isNone() |
boolean |
isSome() |
void |
map_(ProcedureType<T> p)
If this value is
Some(x), evaluate p(x). |
<U> OptionType<U> |
map(FunctionType<T,U> f)
|
<E extends Throwable> |
mapPartial_(PartialProcedureType<T,E> p)
If this value is
Some(x), evaluate p(x). |
<U,E extends Throwable> |
mapPartial(PartialFunctionType<T,U,E> f)
|
void map_(ProcedureType<T> p)
If this value is Some(x), evaluate p(x).
Otherwise, do nothing.
p - The procedure<E extends Throwable> void mapPartial_(PartialProcedureType<T,E> p) throws E extends Throwable
If this value is Some(x), evaluate p(x).
Otherwise, do nothing.
E - The type of exceptions thrown by the procedure.p - The procedureE - Propagated from pE extends Throwable<U> U accept(OptionVisitorType<T,U> v)
U - The type of values returned by the visitor.v - The visitor<U,E extends Throwable> U acceptPartial(OptionPartialVisitorType<T,U,E> v) throws E extends Throwable
U - The type of values returned by the visitor.E - The type of exceptions thrown by the visitor.v - The visitorE - If the visitor throws E.E extends Throwableboolean isNone()
true if the current value is None.boolean isSome()
true if the current value is Some.<U> OptionType<U> map(FunctionType<T,U> f)
If this value is Some(x), return Option.of(Object)
with f(x). Otherwise, return None.
U - The type of returned values.f - The map function.U.<U,E extends Throwable> OptionType<U> mapPartial(PartialFunctionType<T,U,E> f) throws E extends Throwable
If this value is Some(x), return Option.of(Object)
with f(x). Otherwise, return None.
E - The type of exceptions raised.U - The type of returned values.f - The map function.U.E - If f throws E.E extends ThrowableCopyright © 2017 <code@io7m.com> http://io7m.com