public class Some<T> extends Option<T>
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Option<T> |
filter(Function1<T,Boolean> f)
Selects all elements of this sequence which satisfy a predicate.
|
<U> Option<U> |
flatMap(Function1<T,Option<U>> f)
Returns the result of applying f to this Option's value if this Option is
nonempty.
|
<U> Function1<Function1<T,U>,U> |
fold(U ifEmpty) |
<U> U |
fold(U ifEmpty,
Function1<T,U> f)
Returns the result of applying $f to this $option's value if the $option
is nonempty.
|
void |
foreach(VoidFunction1<T> f)
Applies a function f to all elements of this sequence.
|
T |
getOrElse(T defaultValue)
Returns the option's value if the option is nonempty, otherwise return
the result of evaluating default.
|
T |
getOrNull()
scala.Option#orNull()
Returns the option's value if it is nonempty, or null if it is empty.
|
int |
hashCode() |
boolean |
isDefined()
Returns true if the option is an instance of Some, false otherwise.
|
boolean |
isEmpty()
Tests whether the sequence is empty.
|
<U> Option<U> |
map(Function1<T,U> f)
Builds a new collection by applying a function to all elements of this
sequence.
|
List<T> |
toList()
[Original] Produces as java.util.List object
|
String |
toString() |
public Some(T value)
public List<T> toList()
CollectionLikepublic T getOrNull()
Optionpublic T getOrElse(T defaultValue)
Optionpublic boolean isDefined()
Optionpublic boolean isEmpty()
CollectionLikepublic <U> Option<U> map(Function1<T,U> f)
Optionpublic void foreach(VoidFunction1<T> f)
CollectionLikepublic Option<T> filter(Function1<T,Boolean> f)
Optionpublic <U> Option<U> flatMap(Function1<T,Option<U>> f)
Optionpublic <U> U fold(U ifEmpty,
Function1<T,U> f)
OptionCopyright © 2015. All rights reserved.