Index
All Classes and Interfaces|All Packages|Serialized Form
A
- accumulator() - Method in class nl.markv.result.collect.ResultListCollector
- accumulator() - Method in class nl.markv.result.collect.ResultSetCollector
- adaptErr() - Method in class nl.markv.result.Err
- adaptErr() - Method in class nl.markv.result.Ok
- adaptErr() - Method in interface nl.markv.result.Result
- adaptOk() - Method in class nl.markv.result.Err
- adaptOk() - Method in class nl.markv.result.Ok
- adaptOk() - Method in interface nl.markv.result.Result
- and(Supplier<Result<U, E>>) - Method in class nl.markv.result.Err
- and(Supplier<Result<U, E>>) - Method in class nl.markv.result.Ok
- and(Supplier<Result<U, E>>) - Method in interface nl.markv.result.Result
- and(Result<U, E>) - Method in class nl.markv.result.Err
- and(Result<U, E>) - Method in class nl.markv.result.Ok
- and(Result<U, E>) - Method in interface nl.markv.result.Result
- attempt() - Method in interface nl.markv.result.Attempt
- attempt(Attempt<U>) - Static method in interface nl.markv.result.Result
-
Attempt to run the given operation.
- Attempt<T> - Interface in nl.markv.result
-
Like
Supplier
, but can throw checked exceptions.
B
- branch(Function<T, R>, Function<E, R>) - Method in class nl.markv.result.Err
- branch(Function<T, R>, Function<E, R>) - Method in class nl.markv.result.Ok
- branch(Function<T, R>, Function<E, R>) - Method in interface nl.markv.result.Result
C
- characteristics() - Method in class nl.markv.result.collect.ResultListCollector
- characteristics() - Method in class nl.markv.result.collect.ResultSetCollector
- combiner() - Method in class nl.markv.result.collect.ResultListCollector
- combiner() - Method in class nl.markv.result.collect.ResultSetCollector
- contains(T) - Method in class nl.markv.result.Err
- contains(T) - Method in class nl.markv.result.Ok
- contains(T) - Method in interface nl.markv.result.Result
- containsErr(E) - Method in class nl.markv.result.Err
- containsErr(E) - Method in class nl.markv.result.Ok
- containsErr(E) - Method in interface nl.markv.result.Result
E
- empty() - Static method in class nl.markv.result.Err
- equals(Object) - Method in class nl.markv.result.Err
- equals(Object) - Method in class nl.markv.result.Ok
- err(E) - Static method in interface nl.markv.result.Result
-
Create an unsuccessful
Result
. - Err<T,
E> - Class in nl.markv.result - errMatches(Predicate<E>) - Method in class nl.markv.result.Err
- errMatches(Predicate<E>) - Method in class nl.markv.result.Ok
- errMatches(Predicate<E>) - Method in interface nl.markv.result.Result
- errOr(E) - Method in class nl.markv.result.Err
-
Like
Result.errOrNullable(E)
, but does not allow null input or output. - errOr(E) - Method in class nl.markv.result.Ok
-
Like
Result.errOrNullable(E)
, but does not allow null input or output. - errOr(E) - Method in interface nl.markv.result.Result
-
Like
Result.errOrNullable(E)
, but does not allow null input or output. - errOr(Supplier<E>) - Method in class nl.markv.result.Err
-
Like
Result.errOrNullable(Supplier)
, but does not allow null input or output. - errOr(Supplier<E>) - Method in class nl.markv.result.Ok
-
Like
Result.errOrNullable(Supplier)
, but does not allow null input or output. - errOr(Supplier<E>) - Method in interface nl.markv.result.Result
-
Like
Result.errOrNullable(Supplier)
, but does not allow null input or output. - errOrNull() - Method in class nl.markv.result.Err
- errOrNull() - Method in class nl.markv.result.Ok
- errOrNull() - Method in interface nl.markv.result.Result
- errOrNullable(E) - Method in class nl.markv.result.Err
- errOrNullable(E) - Method in class nl.markv.result.Ok
- errOrNullable(E) - Method in interface nl.markv.result.Result
- errOrNullable(Supplier<E>) - Method in class nl.markv.result.Err
- errOrNullable(Supplier<E>) - Method in class nl.markv.result.Ok
- errOrNullable(Supplier<E>) - Method in interface nl.markv.result.Result
F
- finisher() - Method in class nl.markv.result.collect.ResultListCollector
- finisher() - Method in class nl.markv.result.collect.ResultSetCollector
- flatMap(Function<T, Result<U, E>>) - Method in class nl.markv.result.Err
- flatMap(Function<T, Result<U, E>>) - Method in class nl.markv.result.Ok
- flatMap(Function<T, Result<U, E>>) - Method in interface nl.markv.result.Result
- flatMapErr(Function<E, Result<T, F>>) - Method in class nl.markv.result.Err
- flatMapErr(Function<E, Result<T, F>>) - Method in class nl.markv.result.Ok
- flatMapErr(Function<E, Result<T, F>>) - Method in interface nl.markv.result.Result
- flatten(Result<Result<U, F>, F>) - Static method in interface nl.markv.result.Result
-
Flatten a nested result.
- from(Optional<T>) - Static method in interface nl.markv.result.Result
- fromNullable(T) - Static method in interface nl.markv.result.Result
-
Create a
Result
from a nullable reference.
G
- get() - Method in class nl.markv.result.Err
-
Returns the value contained by this
Ok
. - get() - Static method in class nl.markv.result.None
- get() - Method in class nl.markv.result.Ok
-
Returns the value contained by this
Ok
. - getErrOrThrow() - Method in class nl.markv.result.Err
- getErrOrThrow() - Method in class nl.markv.result.Ok
-
Deprecated.
- getErrOrThrow() - Method in interface nl.markv.result.Result
- getErrOrThrow(String) - Method in class nl.markv.result.Err
-
If the
Result
isErr
, return its content, otherwise throwWrongResultVariantException
with the given message. - getErrOrThrow(String) - Method in class nl.markv.result.Ok
-
Deprecated.Marked as deprecated because calling
Ok.getErrOrThrow(String)
onOk
always fails. It is not deprecated to call this onResult
, but onOk
useOk.get()
. - getErrOrThrow(String) - Method in interface nl.markv.result.Result
-
If the
Result
isErr
, return its content, otherwise throwWrongResultVariantException
with the given message. - getErrOrThrow(Supplier<RuntimeException>) - Method in class nl.markv.result.Err
- getErrOrThrow(Supplier<RuntimeException>) - Method in class nl.markv.result.Ok
-
Deprecated.Marked as deprecated because calling
Ok.getErrOrThrow(Supplier)
onOk
always fails. It is not deprecated to call this onResult
, but onOk
useOk.get()
. - getErrOrThrow(Supplier<RuntimeException>) - Method in interface nl.markv.result.Result
- getOrThrow() - Method in class nl.markv.result.Err
-
Deprecated.Marked as deprecated because calling
Err.getOrThrow()
onErr
always fails. It is not deprecated to call this onResult
, but onErr
useErr.get()
. - getOrThrow() - Method in class nl.markv.result.Ok
- getOrThrow() - Method in interface nl.markv.result.Result
- getOrThrow(String) - Method in class nl.markv.result.Err
-
Deprecated.Marked as deprecated because calling
Err.getOrThrow(String)
onErr
always fails. It is not deprecated to call this onResult
, but onErr
useErr.get()
. - getOrThrow(String) - Method in class nl.markv.result.Ok
-
If the
Result
isOk
, return its content, otherwise throwWrongResultVariantException
with the given message. - getOrThrow(String) - Method in interface nl.markv.result.Result
-
If the
Result
isOk
, return its content, otherwise throwWrongResultVariantException
with the given message. - getOrThrow(Supplier<RuntimeException>) - Method in class nl.markv.result.Err
-
Deprecated.Marked as deprecated because calling
Err.getOrThrow(Supplier)
onErr
always fails. It is not deprecated to call this onResult
, but onErr
useErr.get()
. - getOrThrow(Supplier<RuntimeException>) - Method in class nl.markv.result.Ok
- getOrThrow(Supplier<RuntimeException>) - Method in interface nl.markv.result.Result
- getUnified() - Method in class nl.markv.result.Err
- getUnified() - Method in class nl.markv.result.Ok
- getUnified() - Method in interface nl.markv.result.Result
H
- hashCode() - Method in class nl.markv.result.Err
- hashCode() - Method in class nl.markv.result.Ok
I
- ifEither(Consumer<T>, Consumer<E>) - Method in class nl.markv.result.Err
- ifEither(Consumer<T>, Consumer<E>) - Method in class nl.markv.result.Ok
- ifEither(Consumer<T>, Consumer<E>) - Method in interface nl.markv.result.Result
- ifErr(Consumer<E>) - Method in class nl.markv.result.Err
-
Run an action on the value of
Err
. - ifErr(Consumer<E>) - Method in class nl.markv.result.Ok
-
Run an action on the value of
Err
. - ifErr(Consumer<E>) - Method in interface nl.markv.result.Result
-
Run an action on the value of
Err
. - ifOk(Consumer<T>) - Method in class nl.markv.result.Err
-
Run an action on the value of
Ok
. - ifOk(Consumer<T>) - Method in class nl.markv.result.Ok
-
Run an action on the value of
Ok
. - ifOk(Consumer<T>) - Method in interface nl.markv.result.Result
-
Run an action on the value of
Ok
. - isErr() - Method in interface nl.markv.result.Result
- isOk() - Method in class nl.markv.result.Err
- isOk() - Method in class nl.markv.result.Ok
- isOk() - Method in interface nl.markv.result.Result
- iterator() - Method in class nl.markv.result.Err
-
Returns an iterator containing no values, since this result is not
Ok
. - iterator() - Method in class nl.markv.result.Ok
-
Returns an iterator containing a single value - the content of this
Ok
.
M
- map(Function<T, U>) - Method in class nl.markv.result.Err
-
Map the
Ok
value to a new value of a different type. - map(Function<T, U>) - Method in class nl.markv.result.Ok
-
Map the
Ok
value to a new value of a different type. - map(Function<T, U>) - Method in interface nl.markv.result.Result
-
Map the
Ok
value to a new value of a different type. - mapErr(Function<E, F>) - Method in class nl.markv.result.Err
-
Map the
Err
value to a new value of a different type. - mapErr(Function<E, F>) - Method in class nl.markv.result.Ok
-
Map the
Err
value to a new value of a different type. - mapErr(Function<E, F>) - Method in interface nl.markv.result.Result
-
Map the
Err
value to a new value of a different type. - matches(Predicate<T>) - Method in class nl.markv.result.Err
- matches(Predicate<T>) - Method in class nl.markv.result.Ok
- matches(Predicate<T>) - Method in interface nl.markv.result.Result
N
- nl.markv.result - package nl.markv.result
- nl.markv.result.collect - package nl.markv.result.collect
- none - Static variable in class nl.markv.result.None
- None - Class in nl.markv.result
-
A very simple, empty class to represent 'nothing'.
O
- of(E) - Static method in class nl.markv.result.Err
-
Create a new, unsuccessful
Result
. - of(T) - Static method in class nl.markv.result.Ok
-
Create a new, successful
Result
. - ok(T) - Static method in interface nl.markv.result.Result
-
Create a successful
Result
. - Ok<T,
E> - Class in nl.markv.result - okOr(Supplier<T>) - Method in class nl.markv.result.Err
-
Like
Result.okOrNullable(Supplier)
, but does not allow null input or output. - okOr(Supplier<T>) - Method in class nl.markv.result.Ok
-
Like
Result.okOrNullable(Supplier)
, but does not allow null input or output. - okOr(Supplier<T>) - Method in interface nl.markv.result.Result
-
Like
Result.okOrNullable(Supplier)
, but does not allow null input or output. - okOr(T) - Method in class nl.markv.result.Err
-
Like
Result.okOrNullable(T)
, but does not allow null input or output. - okOr(T) - Method in class nl.markv.result.Ok
-
Like
Result.okOrNullable(T)
, but does not allow null input or output. - okOr(T) - Method in interface nl.markv.result.Result
-
Like
Result.okOrNullable(T)
, but does not allow null input or output. - okOrNull() - Method in class nl.markv.result.Err
- okOrNull() - Method in class nl.markv.result.Ok
- okOrNull() - Method in interface nl.markv.result.Result
- okOrNullable(Supplier<T>) - Method in class nl.markv.result.Err
- okOrNullable(Supplier<T>) - Method in class nl.markv.result.Ok
- okOrNullable(Supplier<T>) - Method in interface nl.markv.result.Result
- okOrNullable(T) - Method in class nl.markv.result.Err
- okOrNullable(T) - Method in class nl.markv.result.Ok
- okOrNullable(T) - Method in interface nl.markv.result.Result
- or(Supplier<Result<T, F>>) - Method in class nl.markv.result.Err
- or(Supplier<Result<T, F>>) - Method in class nl.markv.result.Ok
- or(Supplier<Result<T, F>>) - Method in interface nl.markv.result.Result
- or(Result<T, F>) - Method in class nl.markv.result.Err
- or(Result<T, F>) - Method in class nl.markv.result.Ok
- or(Result<T, F>) - Method in interface nl.markv.result.Result
R
- recover(Function<E, T>) - Method in class nl.markv.result.Err
- recover(Function<E, T>) - Method in class nl.markv.result.Ok
- recover(Function<E, T>) - Method in interface nl.markv.result.Result
- Result<T,
E> - Interface in nl.markv.result -
Sometimes a method can either succeed or fail.
- ResultCollector - Class in nl.markv.result.collect
-
Utility class with several methods to create
Result
-related collectors. - ResultListCollector<T,
E> - Class in nl.markv.result.collect - ResultListCollector(Function<ResultBuilder<List<T>, E>, Result<List<T>, E>>) - Constructor for class nl.markv.result.collect.ResultListCollector
- ResultSetCollector<T,
E> - Class in nl.markv.result.collect - ResultSetCollector(Supplier<Set<T>>, Function<ResultBuilder<Set<T>, E>, Result<Set<T>, E>>) - Constructor for class nl.markv.result.collect.ResultSetCollector
S
- stream() - Method in class nl.markv.result.Err
-
Returns a stream containing no values, since this result is not
Ok
. - stream() - Method in class nl.markv.result.Ok
-
Returns a stream containing a single value - the content of this
Ok
. - stream() - Method in interface nl.markv.result.Result
- supplier() - Method in class nl.markv.result.collect.ResultListCollector
- supplier() - Method in class nl.markv.result.collect.ResultSetCollector
T
- toList() - Static method in class nl.markv.result.collect.ResultCollector
-
Collector to collect a stream of
Result
s to a list. - toMutableList() - Static method in class nl.markv.result.collect.ResultCollector
-
Returns the first failure or a list of all okay values.
- toMutableSet() - Static method in class nl.markv.result.collect.ResultCollector
-
Returns any failure or a list of all okay values.
- toOrderedSet() - Static method in class nl.markv.result.collect.ResultCollector
-
Returns any failure or a list of all okay values.
- toSet() - Static method in class nl.markv.result.collect.ResultCollector
-
Returns any failure or a list of all okay values.
- toString() - Method in class nl.markv.result.Err
- toString() - Method in class nl.markv.result.Ok
- transpose(List<Result<U, F>>) - Static method in interface nl.markv.result.Result
-
Given a list of results, if it contains an error, return the first one.
- transpose(Optional<Result<U, F>>) - Static method in interface nl.markv.result.Result
-
Transform
Optional
ofResult
toResult
ofOptional
:Some(Ok(x))
toOk(Some(x))
Some(Err(y))
toErr(y)
None
toOk(None)
SeeResult.transpose(Result)
for the inverse. - transpose(Set<Result<U, F>>) - Static method in interface nl.markv.result.Result
-
Given a set of results, if it contains any errors, return the 'first' one ('first' may be arbitrary for many
Set
implementation). - transpose(Result<Optional<U>, F>) - Static method in interface nl.markv.result.Result
-
Transform
Result
ofOptional
toOptional
ofResult
:Ok(Some(x))
toSome(Ok(x))
Ok(None)
toNone
Err(y)
toSome(Err(y))
SeeResult.transpose(Optional)
for the inverse.
W
- withoutErr() - Method in class nl.markv.result.Err
- withoutErr() - Method in class nl.markv.result.Ok
- withoutErr() - Method in interface nl.markv.result.Result
- withoutOk() - Method in class nl.markv.result.Err
- withoutOk() - Method in class nl.markv.result.Ok
- withoutOk() - Method in interface nl.markv.result.Result
- WrongResultVariantException - Exception in nl.markv.result
- WrongResultVariantException(String) - Constructor for exception nl.markv.result.WrongResultVariantException
All Classes and Interfaces|All Packages|Serialized Form
Ok.getErrOrThrow()
onOk
always fails. It is not deprecated to call this onResult
, but onOk
useOk.get()
.