Index

A B C D E F G H I J M N O P R S T V W Z 
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 Callable and capture any thrown exception as a typed Result.Err.

B

backoffFactor() - Method in record class dev.fforj.Retry.Policy
Returns the value of the backoffFactor record 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): initialDelay scaled by backoffFactor once per prior retry, capped at maxDelay.
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 Err record class.
error() - Method in record class dev.fforj.Result.Err
Returns the value of the error record component.
errors() - Method in record class dev.fforj.Validated.Invalid
Returns the value of the errors record 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 Optional into a Result: a present value becomes Result.Ok, an empty Optional becomes Result.Err carrying ifEmpty.get().
fromResult(Result) - Static method in interface dev.fforj.Validated
Lift a Result into a single-error Validated.

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 head record 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 initialDelay record 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 Invalid record class.
isErr() - Method in interface dev.fforj.Result
true if this is Result.Err.
isInvalid() - Method in interface dev.fforj.Validated
true if this is Validated.Invalid.
isOk() - Method in interface dev.fforj.Result
true if this is Result.Ok.
isValid() - Method in interface dev.fforj.Validated
true if this is Validated.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 jitter record 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 maxAttempts record component.
maxDelay() - Method in record class dev.fforj.Retry.Policy
Returns the value of the maxDelay record 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 NonEmptyList record 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 Ok record 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 Result inside a binding block: returns the value if Result.Ok, otherwise short-circuits the enclosing block, which then evaluates to that Result.Err.
on(Result) - Method in interface dev.fforj.Validated.Accumulator
Bind a Result: Err accumulates as a single error.
on(Validated) - Method in interface dev.fforj.Validated.Accumulator
Bind a Validated: a Valid's value becomes available via Validated.Bound.value(); an Invalid's errors are added to the accumulator.
on(Optional, Supplier) - Method in interface dev.fforj.Result.Binder
Bind an Optional inside a binding block: a present value is returned, an empty Optional short-circuits the block with ifEmpty.get().
on(Optional, Supplier) - Method in interface dev.fforj.Validated.Accumulator
Bind an Optional: empty accumulates ifEmpty.get().
onEach(List, Function) - Method in interface dev.fforj.Validated.Accumulator
Bind a validation of every element of a list (on of a traverse): every failing element contributes its errors, and the Validated.Bound yields 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 Policy record 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 T or fails with an E.
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 body up to Retry.Policy.maxAttempts times until it succeeds, the error fails the shouldRetry predicate, 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 tail record 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 Valid record class.
Validated<E,T> - Interface in dev.fforj
Like Result, but the Invalid case 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 accumulate block, 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 value record component.
value() - Method in interface dev.fforj.Validated.Bound
Unwrap: returns the bound value if its validation succeeded; if it failed, aborts the enclosing accumulate block, which then evaluates to Validated.Invalid carrying every error accumulated so far.
value() - Method in record class dev.fforj.Validated.Valid
Returns the value of the value record 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.
A B C D E F G H I J M N O P R S T V W Z 
All Classes and Interfaces|All Packages