Package | Description |
---|---|
javascalautils |
Contains various utility classes translated from the Scala language.
|
javascalautils.concurrent |
Contains utilities for concurrent/asynchronous programming.
|
Modifier and Type | Class and Description |
---|---|
class |
None<T>
Represents an empty
Option . |
class |
Some<T>
Represents an
Option holding a value. |
Modifier and Type | Method and Description |
---|---|
static <T> Option<T> |
Option.apply(T value)
Creates an instance of Option.
|
default Option<T> |
Try.asOption()
|
static <T> Option<T> |
Option.empty()
Returns an empty Option.
|
Option<Either<L,R>> |
LeftProjection.filter(java.util.function.Predicate<L> predicate)
|
Option<Either<L,R>> |
RightProjection.filter(java.util.function.Predicate<R> predicate)
|
default Option<T> |
Option.filter(java.util.function.Predicate<T> predicate)
Returns this Option if it is nonempty and applying the predicate p to this Option's value returns
true . |
default Option<T> |
Option.filterNot(java.util.function.Predicate<T> predicate)
Returns this Option if it is nonempty and applying the predicate p to this Option's value returns
false . |
<R> Option<R> |
None.flatMap(java.util.function.Function<T,Option<R>> function)
Always returns
this . |
<R> Option<R> |
Option.flatMap(java.util.function.Function<T,Option<R>> function)
Returns an Option consisting of the result of applying the given function to the current
Some . |
<R> Option<R> |
Some.flatMap(java.util.function.Function<T,Option<R>> function)
Returns an Option consisting of the result of applying the given function to the current value.
|
<R> Option<R> |
None.map(java.util.function.Function<T,R> function)
Always returns
this . |
<R> Option<R> |
Option.map(java.util.function.Function<T,R> function)
Returns an Option consisting of the result of applying the given function to the current
Some . |
<R> Option<R> |
Some.map(java.util.function.Function<T,R> f)
Returns an
Option containing the value of applying the given function to the current value. |
static <T> Option<T> |
Option.None()
Returns an empty Option.
|
static <T> Option<T> |
Option.ofOptional(Optional<T> optional)
|
static <T> Option<T> |
OptionCompanion.Option(T value)
Creates an instance of Option.
|
Option<T> |
None.orElse(java.util.function.Supplier<Option<T>> supplier)
Always the value provided by the supplier.
|
Option<T> |
Option.orElse(java.util.function.Supplier<Option<T>> supplier)
Returns this Option if it is nonempty, otherwise return the result of provided by the supplier.
|
Option<T> |
Some.orElse(java.util.function.Supplier<Option<T>> s)
Always returns this.
|
Modifier and Type | Method and Description |
---|---|
<R> Option<R> |
None.flatMap(java.util.function.Function<T,Option<R>> function)
Always returns
this . |
<R> Option<R> |
Option.flatMap(java.util.function.Function<T,Option<R>> function)
Returns an Option consisting of the result of applying the given function to the current
Some . |
<R> Option<R> |
Some.flatMap(java.util.function.Function<T,Option<R>> function)
Returns an Option consisting of the result of applying the given function to the current value.
|
Option<T> |
None.orElse(java.util.function.Supplier<Option<T>> supplier)
Always the value provided by the supplier.
|
Option<T> |
Option.orElse(java.util.function.Supplier<Option<T>> supplier)
Returns this Option if it is nonempty, otherwise return the result of provided by the supplier.
|
Option<T> |
Some.orElse(java.util.function.Supplier<Option<T>> s)
Always returns this.
|
Modifier and Type | Method and Description |
---|---|
Option<Try<T>> |
Future.value()
The current (completed or not) value of the future.
|
Copyright © 2016, Peter Nerg Apache License v2.0