T - The type of values.@EqualityStructural public final class Some<T> extends Object implements OptionType<T>
A value.
OptionType,
Serialized Form| 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 |
equals(Object obj) |
T |
get() |
int |
hashCode() |
boolean |
isNone() |
boolean |
isSome() |
<U> OptionType<U> |
map(FunctionType<T,U> f)
|
<U,E extends Throwable> |
mapPartial(PartialFunctionType<T,U,E> f)
|
String |
toString() |
public <U> U accept(OptionVisitorType<T,U> v)
OptionTypeaccept in interface OptionType<T>U - The type of values returned by the visitor.v - The visitorpublic <U,E extends Throwable> U acceptPartial(OptionPartialVisitorType<T,U,E> v) throws E extends Throwable
OptionTypeacceptPartial in interface OptionType<T>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 Throwablepublic T get()
public <U> OptionType<U> map(FunctionType<T,U> f)
OptionType
If this value is Some(x), return Option.of(Object)
with f(x). Otherwise, return None.
map in interface OptionType<T>U - The type of returned values.f - The map function.U.public <U,E extends Throwable> OptionType<U> mapPartial(PartialFunctionType<T,U,E> f) throws E extends Throwable
OptionType
If this value is Some(x), return Option.of(Object)
with f(x). Otherwise, return None.
mapPartial in interface OptionType<T>U - The type of returned values.E - The type of exceptions raised.f - The map function.U.E - If f throws E.E extends Throwablepublic boolean isNone()
isNone in interface OptionType<T>true if the current value is None.public boolean isSome()
isSome in interface OptionType<T>true if the current value is Some.Copyright © 2014 <code@io7m.com> http://io7m.com