Index
All Classes and Interfaces|All Packages
A
- accumulate(Function) - Static method in interface dev.fforj.Validated
-
Error-accumulation DSL: validate several independent pieces as straight-line code and surface every failure at once.
- append(T, T...) - Method in record class dev.fforj.NonEmptyList
-
Append one or more elements.
- attempt(Callable, Function) - Static method in interface dev.fforj.Result
-
Run a
Callableand capture any thrown exception as a typedResult.Err.
B
- backoffFactor() - Method in record class dev.fforj.Retry.Policy
-
Returns the value of the
backoffFactorrecord component. - binding(Function) - Static method in interface dev.fforj.Result
-
Sequence several
Result-returning calls as straight-line code, unwrapping each success and short-circuiting on the first failure.
C
- concat(NonEmptyList) - Method in record class dev.fforj.NonEmptyList
-
Concatenate two non-empty lists.
D
- delayBefore(int) - Method in record class dev.fforj.Retry.Policy
-
The planned delay before the given attempt (the first retry is attempt
2):initialDelayscaled bybackoffFactoronce per prior retry, capped atmaxDelay. - dev.fforj - package dev.fforj
E
- ensure(boolean, Supplier) - Method in interface dev.fforj.Result.Binder
-
Assert a condition with no value to bind: a guard, a permission check, an invariant.
- ensure(boolean, Supplier) - Method in interface dev.fforj.Validated.Accumulator
-
Check a condition with no value to bind: a guard, a limit, a cross-field rule.
- equals(Object) - Method in record class dev.fforj.NonEmptyList
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class dev.fforj.Result.Err
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class dev.fforj.Result.Ok
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class dev.fforj.Retry.Policy
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class dev.fforj.Validated.Invalid
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class dev.fforj.Validated.Valid
-
Indicates whether some other object is "equal to" this one.
- err(E) - Static method in interface dev.fforj.Result
-
Build a failure.
- Err(E) - Constructor for record class dev.fforj.Result.Err
-
Creates an instance of a
Errrecord class. - error() - Method in record class dev.fforj.Result.Err
-
Returns the value of the
errorrecord component. - errors() - Method in record class dev.fforj.Validated.Invalid
-
Returns the value of the
errorsrecord component. - errValue() - Method in interface dev.fforj.Result
-
Returns the error if
Result.Err, else empty. - exponential(int, Duration) - Static method in record class dev.fforj.Retry.Policy
-
Exponential backoff (doubling) between retries.
F
- fixed(int, Duration) - Static method in record class dev.fforj.Retry.Policy
-
Constant delay between retries.
- flatMap(Function) - Method in interface dev.fforj.Result
-
Sequential composition: chain another operation that itself may fail.
- fold(Function, Function) - Method in interface dev.fforj.Validated
-
Fold both cases into a single value.
- fold(Function, Function) - Method in interface dev.fforj.Result
-
Fold both cases into a single value.
- fromList(List) - Static method in record class dev.fforj.NonEmptyList
-
Try to lift a
List. - fromOptional(Optional, Supplier) - Static method in interface dev.fforj.Result
-
Lift an
Optionalinto aResult: a present value becomesResult.Ok, an emptyOptionalbecomesResult.ErrcarryingifEmpty.get(). - fromResult(Result) - Static method in interface dev.fforj.Validated
-
Lift a
Resultinto a single-errorValidated.
G
- getOrElse(T) - Method in interface dev.fforj.Result
-
Provide a fallback when this is
Result.Err. - getOrElseGet(Function) - Method in interface dev.fforj.Result
-
Provide a lazy fallback when this is
Result.Err.
H
- hashCode() - Method in record class dev.fforj.NonEmptyList
-
Returns a hash code value for this object.
- hashCode() - Method in record class dev.fforj.Result.Err
-
Returns a hash code value for this object.
- hashCode() - Method in record class dev.fforj.Result.Ok
-
Returns a hash code value for this object.
- hashCode() - Method in record class dev.fforj.Retry.Policy
-
Returns a hash code value for this object.
- hashCode() - Method in record class dev.fforj.Validated.Invalid
-
Returns a hash code value for this object.
- hashCode() - Method in record class dev.fforj.Validated.Valid
-
Returns a hash code value for this object.
- head() - Method in record class dev.fforj.NonEmptyList
-
Returns the value of the
headrecord component. - How it short-circuits, and the one caveat - Section in dev.fforj.Result.binding(Function)
I
- initialDelay() - Method in record class dev.fforj.Retry.Policy
-
Returns the value of the
initialDelayrecord component. - invalid(NonEmptyList) - Static method in interface dev.fforj.Validated
-
Build a failure carrying one or more accumulated errors.
- invalid(E) - Static method in interface dev.fforj.Validated
-
Build a failure carrying a single error.
- Invalid(NonEmptyList) - Constructor for record class dev.fforj.Validated.Invalid
-
Creates an instance of a
Invalidrecord class. - isErr() - Method in interface dev.fforj.Result
-
trueif this isResult.Err. - isInvalid() - Method in interface dev.fforj.Validated
-
trueif this isValidated.Invalid. - isOk() - Method in interface dev.fforj.Result
-
trueif this isResult.Ok. - isValid() - Method in interface dev.fforj.Validated
-
trueif this isValidated.Valid. - iterator() - Method in record class dev.fforj.NonEmptyList
-
Iterate all elements, head first.
J
- jitter() - Method in record class dev.fforj.Retry.Policy
-
Returns the value of the
jitterrecord component.
M
- map(Function) - Method in record class dev.fforj.NonEmptyList
-
Transform every element; the result is non-empty by construction.
- map(Function) - Method in interface dev.fforj.Result
-
Transform the success value; preserve the error.
- map(Function) - Method in interface dev.fforj.Validated
-
Transform the success value; preserve the errors.
- mapErr(Function) - Method in interface dev.fforj.Result
-
Transform the error; preserve the success value.
- mapErr(Function) - Method in interface dev.fforj.Validated
-
Transform every error in the batch; preserve the valid value.
- maxAttempts() - Method in record class dev.fforj.Retry.Policy
-
Returns the value of the
maxAttemptsrecord component. - maxDelay() - Method in record class dev.fforj.Retry.Policy
-
Returns the value of the
maxDelayrecord component.
N
- NonEmptyList<T> - Record Class in dev.fforj
-
An immutable sequence with a compile-time guarantee that it contains at least one element.
- NonEmptyList(T, List) - Constructor for record class dev.fforj.NonEmptyList
-
Creates an instance of a
NonEmptyListrecord class.
O
- of(T) - Static method in record class dev.fforj.NonEmptyList
-
One element.
- of(T, T...) - Static method in record class dev.fforj.NonEmptyList
-
One element + N more.
- ok(T) - Static method in interface dev.fforj.Result
-
Build a success.
- Ok(T) - Constructor for record class dev.fforj.Result.Ok
-
Creates an instance of a
Okrecord class. - okValue() - Method in interface dev.fforj.Result
-
Returns the success value if
Result.Ok, else empty. - on(Result) - Method in interface dev.fforj.Result.Binder
-
Unwrap a
Resultinside abindingblock: returns the value ifResult.Ok, otherwise short-circuits the enclosing block, which then evaluates to thatResult.Err. - on(Result) - Method in interface dev.fforj.Validated.Accumulator
-
Bind a
Result:Erraccumulates as a single error. - on(Validated) - Method in interface dev.fforj.Validated.Accumulator
-
Bind a
Validated: aValid's value becomes available viaValidated.Bound.value(); anInvalid's errors are added to the accumulator. - on(Optional, Supplier) - Method in interface dev.fforj.Result.Binder
- on(Optional, Supplier) - Method in interface dev.fforj.Validated.Accumulator
-
Bind an
Optional: empty accumulatesifEmpty.get(). - onEach(List, Function) - Method in interface dev.fforj.Validated.Accumulator
-
Bind a validation of every element of a list (
onof atraverse): every failing element contributes its errors, and theValidated.Boundyields the fully-parsed list. - orElseThrow(Function) - Method in interface dev.fforj.Result
-
Throw a custom exception on failure; return the value otherwise.
P
- Policy(int, Duration, double) - Constructor for record class dev.fforj.Retry.Policy
-
Uncapped, jitter-free policy; the common starting point.
- Policy(int, Duration, double, Duration, double) - Constructor for record class dev.fforj.Retry.Policy
-
Creates an instance of a
Policyrecord class.
R
- recover(Function) - Method in interface dev.fforj.Result
-
Recover from a failure with another
Result. - Result<E,
T> - Interface in dev.fforj -
Sum type for an operation that either succeeds with a
Tor fails with anE. - Result.Binder<E> - Interface in dev.fforj
-
The unwrapping handle passed to
Result.binding(Function). - Result.Err<E,
T> - Record Class in dev.fforj -
Failure case: carries an
E. - Result.Ok<E,
T> - Record Class in dev.fforj -
Success case: carries a
T. - Retry - Class in dev.fforj
-
Retry policies for fallible operations.
- Retry.Policy - Record Class in dev.fforj
-
Policy parameters.
- run(Retry.Policy, Predicate, IntFunction) - Static method in class dev.fforj.Retry
-
Run
bodyup toRetry.Policy.maxAttemptstimes until it succeeds, the error fails theshouldRetrypredicate, or the caller's thread is interrupted. - run(Retry.Policy, Predicate, Supplier) - Static method in class dev.fforj.Retry
-
run, for bodies that don't care which attempt they're on.
S
- size() - Method in record class dev.fforj.NonEmptyList
-
Total element count: head plus tail; always at least 1.
- stream() - Method in record class dev.fforj.NonEmptyList
-
Stream all elements, head first.
T
- tail() - Method in record class dev.fforj.NonEmptyList
-
Returns the value of the
tailrecord component. - tap(Consumer) - Method in interface dev.fforj.Result
-
Observe the success value (logging, metrics) and pass the result through unchanged.
- tapErr(Consumer) - Method in interface dev.fforj.Result
-
Observe the error (logging, metrics) and pass the result through unchanged.
- toList() - Method in record class dev.fforj.NonEmptyList
-
Convert to an immutable plain
List, head first. - toResult() - Method in interface dev.fforj.Validated
-
Convert back into a
Result. - toString() - Method in record class dev.fforj.NonEmptyList
-
Returns a string representation of this record class.
- toString() - Method in record class dev.fforj.Result.Err
-
Returns a string representation of this record class.
- toString() - Method in record class dev.fforj.Result.Ok
-
Returns a string representation of this record class.
- toString() - Method in record class dev.fforj.Retry.Policy
-
Returns a string representation of this record class.
- toString() - Method in record class dev.fforj.Validated.Invalid
-
Returns a string representation of this record class.
- toString() - Method in record class dev.fforj.Validated.Valid
-
Returns a string representation of this record class.
- traverse(NonEmptyList, Function) - Static method in interface dev.fforj.Validated
-
traverse, preserving non-emptiness. - traverse(List, Function) - Static method in interface dev.fforj.Validated
-
Validate every element of a list with one function, accumulating every failure: the accumulative "traverse".
V
- valid(T) - Static method in interface dev.fforj.Validated
-
Build a success.
- Valid(T) - Constructor for record class dev.fforj.Validated.Valid
-
Creates an instance of a
Validrecord class. - Validated<E,
T> - Interface in dev.fforj -
Like
Result, but theInvalidcase accumulates ALL errors instead of short-circuiting on the first one. - Validated.Accumulator<E> - Interface in dev.fforj
-
The binding handle passed to
Validated.accumulate(Function). - Validated.Bound<T> - Interface in dev.fforj
-
A value bound inside an
accumulateblock, not yet unwrapped. - Validated.Invalid<E,
T> - Record Class in dev.fforj - Validated.Valid<E,
T> - Record Class in dev.fforj - value() - Method in record class dev.fforj.Result.Ok
-
Returns the value of the
valuerecord component. - value() - Method in interface dev.fforj.Validated.Bound
-
Unwrap: returns the bound value if its validation succeeded; if it failed, aborts the enclosing
accumulateblock, which then evaluates toValidated.Invalidcarrying every error accumulated so far. - value() - Method in record class dev.fforj.Validated.Valid
-
Returns the value of the
valuerecord component.
W
- withJitter(double) - Method in record class dev.fforj.Retry.Policy
-
Same policy with the given jitter fraction (see
Retry.Policy.jitter). - withMaxDelay(Duration) - Method in record class dev.fforj.Retry.Policy
-
Same policy with every delay capped at
maxDelay.
Z
- zip(Result, BiFunction) - Method in interface dev.fforj.Result
-
Combine two results into one via a binary function; both must be
Result.Ok. - zip(Validated, BiFunction) - Method in interface dev.fforj.Validated
-
Combine two
Validateds into one via a binary function.
All Classes and Interfaces|All Packages