Index
All Classes and Interfaces|All Packages
C
- cause() - Method in record class codes.domix.fun.Try.Failure
-
Returns the value of the
causerecord component. - codes.domix.fun - module codes.domix.fun
-
Functional programming constructions for Java.
- codes.domix.fun - package codes.domix.fun
- collectPresent(Stream<Option<V>>) - Static method in interface codes.domix.fun.Option
-
Collects all present (non-empty) values from a stream of
Optioninstances into a list.
E
- equals(Object) - Method in record class codes.domix.fun.Option.None
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class codes.domix.fun.Option.Some
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class codes.domix.fun.Result.Err
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class codes.domix.fun.Result.Ok
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class codes.domix.fun.Try.Failure
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class codes.domix.fun.Try.Success
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class codes.domix.fun.Tuple2
-
Indicates whether some other object is "equal to" this one.
- err(Error) - Static method in interface codes.domix.fun.Result
-
Creates a
Resultinstance representing an erroneous result with the given error value. - err(Error, Class<Value>) - Static method in interface codes.domix.fun.Result
-
Deprecated, for removal: This API element is subject to removal in a future version.
- Err(Error) - Constructor for record class codes.domix.fun.Result.Err
-
Compact canonical constructor — validates that
erroris non-null. - error() - Method in record class codes.domix.fun.Result.Err
-
Returns the value of the
errorrecord component.
F
- failure(Throwable) - Static method in interface codes.domix.fun.Try
-
Creates a
Tryinstance representing a failure with the given cause. - Failure(Throwable) - Constructor for record class codes.domix.fun.Try.Failure
-
Compact canonical constructor — validates that
causeis non-null. - filter(Predicate<? super Value>) - Method in interface codes.domix.fun.Option
-
Filters the value of this Option based on the provided predicate.
- filter(Predicate<? super Value>) - Method in interface codes.domix.fun.Try
-
Filters the Try based on the given predicate.
- filter(Predicate<? super Value>, Function<? super Value, ? extends Throwable>) - Method in interface codes.domix.fun.Try
-
Filters this
Tryusing a predicate and a contextual error function that receives the value that failed the test. - filter(Predicate<? super Value>, Supplier<? extends Throwable>) - Method in interface codes.domix.fun.Try
-
Filters the Try based on the given predicate.
- filter(Predicate<Value>, Error) - Method in interface codes.domix.fun.Result
-
Filters the current result based on the specified predicate.
- filter(Predicate<Value>, Function<Value, Error>) - Method in interface codes.domix.fun.Result
-
Filters the current result by applying a given predicate to its value.
- flatMap(Function<? super Value, Option<NewValue>>) - Method in interface codes.domix.fun.Option
-
Transforms the current Option value using the provided mapping function and flattens the result.
- flatMap(Function<? super Value, Try<NewValue>>) - Method in interface codes.domix.fun.Try
-
Applies the provided mapping function to the value contained within this `Try` instance if it represents a successful outcome.
- flatMap(Function<Value, Result<NewValue, Error>>) - Method in interface codes.domix.fun.Result
-
Applies the given mapping function to the value of a successful
Resultinstance and returns the resultingResult. - flatMapError(Function<Error, Result<Value, E2>>) - Method in interface codes.domix.fun.Result
-
Applies a function to the error of an erroneous result and returns the produced
Result. - fold(Function<? super Value, ? extends Folded>, Function<? super Throwable, ? extends Folded>) - Method in interface codes.domix.fun.Try
-
Folds the current
Tryinstance into a single value by applying one of two provided functions. - fold(Function<Value, Folded>, Function<Error, Folded>) - Method in interface codes.domix.fun.Result
-
Transforms the current
Resultinstance into a value of typeFoldedby applying one of the provided functions based on the state of the instance. - fold(Supplier<? extends Folded>, Function<? super Value, ? extends Folded>) - Method in interface codes.domix.fun.Option
-
Folds the current option into a single value by applying the appropriate function depending on whether the option is a
Someor aNone. - fromOption(Option<? extends V>, E) - Static method in interface codes.domix.fun.Result
- fromOption(Option<? extends V>, Supplier<? extends Throwable>) - Static method in interface codes.domix.fun.Try
- fromOptional(Optional<V>) - Static method in interface codes.domix.fun.Option
- fromResult(Result<? extends V, ? extends E>) - Static method in interface codes.domix.fun.Option
- fromResult(Result<V, ? extends Throwable>) - Static method in interface codes.domix.fun.Try
- fromTry(Try<? extends V>) - Static method in interface codes.domix.fun.Option
- fromTry(Try<V>) - Static method in interface codes.domix.fun.Result
-
Converts a Try instance into a Result instance.
G
- get() - Method in interface codes.domix.fun.Option
-
Retrieves the value held by this
Optioninstance if it is of typeSome. - get() - Method in interface codes.domix.fun.Result
-
Retrieves the value contained within this
Resultinstance if it represents a successful result. - get() - Method in interface codes.domix.fun.Try.CheckedSupplier
-
Retrieves and returns a value, potentially throwing a checked exception during execution.
- get() - Method in interface codes.domix.fun.Try
-
Retrieves the value encapsulated in this instance if it represents a success.
- getCause() - Method in interface codes.domix.fun.Try
-
Retrieves the cause of failure if the instance represents a failed state.
- getError() - Method in interface codes.domix.fun.Result
-
Retrieves the error value of the current instance if it is an Err.
- getOrElse(Value) - Method in interface codes.domix.fun.Option
-
Retrieves the encapsulated value if this
Optioninstance is of typeSome, or returns the provided fallback value if this instance is of typeNone. - getOrElse(Value) - Method in interface codes.domix.fun.Result
-
Returns the value contained in this
Resultinstance if it represents a successful result. - getOrElse(Value) - Method in interface codes.domix.fun.Try
-
Returns the value if this instance is a
Success, or the specified fallback value if it is aFailure. - getOrElseGet(Supplier<? extends Value>) - Method in interface codes.domix.fun.Option
-
Retrieves the encapsulated value if this
Optioninstance is of typeSome, or computes and returns a fallback value supplied by the givenfallbackSupplierif this instance is of typeNone. - getOrElseGet(Supplier<? extends Value>) - Method in interface codes.domix.fun.Try
-
Returns the value of this
Tryif it is aSuccess, or retrieves a fallback value using the providedfallbackSupplierif it is aFailure. - getOrElseGet(Supplier<Value>) - Method in interface codes.domix.fun.Result
-
Retrieves the value contained within this
Resultinstance if it represents a successful result. - getOrElseGetWithError(Function<Error, Value>) - Method in interface codes.domix.fun.Result
-
Returns the value of this
Ok, or applieserrorMapperto the contained error and returns the result. - getOrNull() - Method in interface codes.domix.fun.Option
-
Retrieves the encapsulated value if this
Optioninstance is of typeSome, or returnsnullif this instance is of typeNone. - getOrNull() - Method in interface codes.domix.fun.Result
-
Retrieves the value contained within this
Resultinstance if it represents a successful result, or returnsnullif it represents an erroneous result. - getOrNull() - Method in interface codes.domix.fun.Try
-
Returns the value of this
Tryif it is aSuccess, ornullif it is aFailure. - getOrThrow() - Method in interface codes.domix.fun.Try
-
Returns the successful value if this instance is a
Success, or throws an exception if this instance is aFailure. - getOrThrow(Function<? super Throwable, ? extends RuntimeException>) - Method in interface codes.domix.fun.Try
-
Returns the value if this instance is a Success, or throws the exception provided by the exceptionMapper if this instance is a Failure.
- getOrThrow(Function<Error, ? extends RuntimeException>) - Method in interface codes.domix.fun.Result
-
Retrieves the value of the current
Resultinstance if it represents a successful result, or throws a custom exception mapped from the contained error if it represents an erroneous result. - getOrThrow(Supplier<? extends RuntimeException>) - Method in interface codes.domix.fun.Option
-
Retrieves the encapsulated value if this
Optioninstance is of typeSome.
H
- hashCode() - Method in record class codes.domix.fun.Option.None
-
Returns a hash code value for this object.
- hashCode() - Method in record class codes.domix.fun.Option.Some
-
Returns a hash code value for this object.
- hashCode() - Method in record class codes.domix.fun.Result.Err
-
Returns a hash code value for this object.
- hashCode() - Method in record class codes.domix.fun.Result.Ok
-
Returns a hash code value for this object.
- hashCode() - Method in record class codes.domix.fun.Try.Failure
-
Returns a hash code value for this object.
- hashCode() - Method in record class codes.domix.fun.Try.Success
-
Returns a hash code value for this object.
- hashCode() - Method in record class codes.domix.fun.Tuple2
-
Returns a hash code value for this object.
I
- isDefined() - Method in interface codes.domix.fun.Option
-
Determines whether this instance represents a defined value.
- isEmpty() - Method in interface codes.domix.fun.Option
-
Checks if this
Optioninstance represents the absence of a value. - isError() - Method in interface codes.domix.fun.Result
-
Checks if the current instance represents an erroneous result.
- isFailure() - Method in interface codes.domix.fun.Try
-
Determines if the current instance represents a failure state.
- isOk() - Method in interface codes.domix.fun.Result
-
Checks if the current instance represents a successful result.
- isSuccess() - Method in interface codes.domix.fun.Try
-
Determines if the current instance represents a successful state.
M
- map(Function<? super Value, ? extends NewValue>) - Method in interface codes.domix.fun.Option
-
Transforms the current Option using the provided mapping function.
- map(Function<? super Value, ? extends NewValue>) - Method in interface codes.domix.fun.Try
-
Transforms the value held by this instance using the provided mapping function.
- map(Function<Value, NewValue>) - Method in interface codes.domix.fun.Result
-
Transforms the value of a successful
Resultinstance using the provided mapping function. - map2(Option<? extends A>, Option<? extends B>, BiFunction<? super A, ? super B, ? extends R>) - Static method in interface codes.domix.fun.Option
-
Combines the values of two Option instances using the provided combiner function.
- mapError(Function<Error, NewError>) - Method in interface codes.domix.fun.Result
-
Transforms the error value of an erroneous
Resultinstance using the provided mapping function. - mapFailure(Function<? super Throwable, ? extends Throwable>) - Method in interface codes.domix.fun.Try
-
Transforms the failure cause using the given function, leaving a
Successunchanged. - match(Runnable, Consumer<? super Value>) - Method in interface codes.domix.fun.Option
-
Executes one of the provided actions based on the state of this value.
- match(Consumer<Value>, Consumer<Error>) - Method in interface codes.domix.fun.Result
-
Executes one of the provided
Consumerfunctions based on the state of theResult.
N
- none() - Static method in interface codes.domix.fun.Option
-
Creates an instance of
Optionthat represents the absence of a value. - None() - Constructor for record class codes.domix.fun.Option.None
-
Creates an instance of a
Nonerecord class.
O
- of(Try.CheckedSupplier<? extends V>) - Static method in interface codes.domix.fun.Try
-
Creates a
Tryinstance by executing the givenCheckedSupplier. - ofNullable(V) - Static method in interface codes.domix.fun.Option
-
Creates an Option instance that encapsulates a given value.
- ok(Value) - Static method in interface codes.domix.fun.Result
-
Creates a
Resultinstance representing a successful result with the given value. - ok(Value, Class<Error>) - Static method in interface codes.domix.fun.Result
-
Deprecated, for removal: This API element is subject to removal in a future version.This overload exists only as a type-inference aid and is no longer needed. Use
Result.ok(Object)with an explicit type witness or a typed variable instead:Result.<Value, Error>ok(value)orResult<Value, Error> r = Result.ok(value) - Ok(Value) - Constructor for record class codes.domix.fun.Result.Ok
-
Compact canonical constructor — validates that
valueis non-null. - onFailure(Consumer<? super Throwable>) - Method in interface codes.domix.fun.Try
-
Executes a specified action if this instance represents a failure.
- onSuccess(Consumer<? super Value>) - Method in interface codes.domix.fun.Try
-
Performs the given action if the current instance represents a successful outcome.
- Option<Value> - Interface in codes.domix.fun
-
A sealed interface representing an optional value with two possible states: either a value is present ("Some") or absent ("None").
- Option.None<Value> - Record Class in codes.domix.fun
-
Represents a variant of the
Optiontype that signifies the absence of a value. - Option.Some<Value> - Record Class in codes.domix.fun
-
Represents a container object that holds a non-null value.
- or(Supplier<Result<Value, Error>>) - Method in interface codes.domix.fun.Result
-
Returns this
Resultif it isOk; otherwise evaluates the given supplier and returns its result.
P
- peek(Consumer<? super Value>) - Method in interface codes.domix.fun.Option
-
Applies the provided action to the value contained in this instance if it is of type Some.
- peek(Consumer<Value>) - Method in interface codes.domix.fun.Result
-
Executes the given action if the current
Resultinstance represents a successful result. - peekError(Consumer<Error>) - Method in interface codes.domix.fun.Result
-
Executes the given action if the current
Resultinstance represents an erroneous result. - presentValuesToList() - Static method in interface codes.domix.fun.Option
-
Creates a collector that transforms a stream of Option objects into a list of values by extracting the present values and filtering out any absent values.
R
- recover(Function<? super Throwable, ? extends Value>) - Method in interface codes.domix.fun.Try
-
Recovers from a failure by applying a recovery function to the underlying throwable.
- recover(Function<Error, Value>) - Method in interface codes.domix.fun.Result
-
Converts an erroneous
Resultinto a successful one by applying the given rescue function to the contained error. - recoverWith(Function<? super Throwable, Try<Value>>) - Method in interface codes.domix.fun.Try
-
Recovers from a failure by applying the given recovery function to the cause of the failure.
- recoverWith(Function<Error, Result<Value, E2>>) - Method in interface codes.domix.fun.Result
-
Converts an erroneous
Resultinto a newResultby applying the given rescue function to the contained error. - Result<Value,
Error> - Interface in codes.domix.fun -
A generic sealed interface representing a result type that can either be a successful value (
Result.Ok) or an error (Result.Err). - Result.Err<Value,
Error> - Record Class in codes.domix.fun -
Represents an erroneous result containing an error of type
Error. - Result.Ok<Value,
Error> - Record Class in codes.domix.fun -
Represents a successful result containing a value of type
Value. - run() - Method in interface codes.domix.fun.Try.CheckedRunnable
-
Executes an operation that may throw a checked exception.
- run(Try.CheckedRunnable) - Static method in interface codes.domix.fun.Try
-
Executes the provided
CheckedRunnableand returns aTryinstance representing the outcome of the execution.
S
- sequence(Iterable<Option<V>>) - Static method in interface codes.domix.fun.Option
-
Transforms an iterable of
Option<V>into a singleOption<List<V>>. - sequence(Iterable<Result<V, E>>) - Static method in interface codes.domix.fun.Result
-
Transforms an iterable of
Result<V, E>into a singleResult<List<V>, E>. - sequence(Iterable<Try<V>>) - Static method in interface codes.domix.fun.Try
-
Transforms an iterable of
Try<V>into a singleTry<List<V>>. - sequence(Stream<Option<V>>) - Static method in interface codes.domix.fun.Option
-
Converts a stream of
Optionobjects into a singleOptioncontaining aListof values, if allOptioninstances in the stream areOption.Some. - sequence(Stream<Result<V, E>>) - Static method in interface codes.domix.fun.Result
-
Transforms a stream of
Result<V, E>into a singleResult<List<V>, E>. - sequence(Stream<Try<V>>) - Static method in interface codes.domix.fun.Try
-
Transforms a stream of
Try<V>into a singleTry<List<V>>. - some(V) - Static method in interface codes.domix.fun.Option
-
Creates a
Option.Someinstance that encapsulates the given non-null value. - Some(Value) - Constructor for record class codes.domix.fun.Option.Some
-
Constructs a new
Someinstance with the specified non-null value. - stream() - Method in interface codes.domix.fun.Option
-
Returns a stream representation of the current instance.
- stream() - Method in interface codes.domix.fun.Try
-
Returns a single-element
Streamcontaining the success value, or an empty stream on failure. - success(V) - Static method in interface codes.domix.fun.Try
-
Creates a successful
Tryinstance containing the provided value. - Success(Value) - Constructor for record class codes.domix.fun.Try.Success
-
Creates an instance of a
Successrecord class. - swap() - Method in interface codes.domix.fun.Result
-
Swaps the
OkandErrchannels of thisResult.
T
- toOption() - Method in interface codes.domix.fun.Result
-
Converts the current instance into an
Option<Value>. - toOption() - Method in interface codes.domix.fun.Try
-
Converts the current instance to an Option.
- toOptional() - Method in interface codes.domix.fun.Option
-
Converts the current instance of a value or none container into an
Optional. - toResult() - Method in interface codes.domix.fun.Try
-
Converts the current
Tryinstance into aResultrepresentation. - toResult(Function<? super Throwable, ? extends E>) - Method in interface codes.domix.fun.Try
-
Converts this
Tryinto aResult<Value, E>using a custom error mapper. - toResult(TError) - Method in interface codes.domix.fun.Option
-
Converts the current option to a
Resultinstance. - toString() - Method in record class codes.domix.fun.Option.None
-
Returns a string representation of this record class.
- toString() - Method in record class codes.domix.fun.Option.Some
-
Returns a string representation of this record class.
- toString() - Method in record class codes.domix.fun.Result.Err
-
Returns a string representation of this record class.
- toString() - Method in record class codes.domix.fun.Result.Ok
-
Returns a string representation of this record class.
- toString() - Method in record class codes.domix.fun.Try.Failure
-
Returns a string representation of this record class.
- toString() - Method in record class codes.domix.fun.Try.Success
-
Returns a string representation of this record class.
- toString() - Method in record class codes.domix.fun.Tuple2
-
Returns a string representation of this record class.
- toTry(Function<? super Error, ? extends Throwable>) - Method in interface codes.domix.fun.Result
-
Converts the current result into a
Tryinstance. - toTry(Supplier<? extends Throwable>) - Method in interface codes.domix.fun.Option
-
Converts the current instance to a
Tryinstance. - traverse(Iterable<A>, Function<? super A, Option<B>>) - Static method in interface codes.domix.fun.Option
-
Transforms a collection of values of type A into an optional list of values of type B by applying a given mapping function to each element in the input collection.
- traverse(Iterable<A>, Function<? super A, Result<B, E>>) - Static method in interface codes.domix.fun.Result
-
Maps each element of an iterable through
mapperand collects the results into aResult<List<B>, E>. - traverse(Iterable<A>, Function<? super A, Try<B>>) - Static method in interface codes.domix.fun.Try
-
Maps each element of an iterable through
mapperand collects the results into aTry<List<B>>. - traverse(Stream<A>, Function<? super A, Option<B>>) - Static method in interface codes.domix.fun.Option
-
Transforms a stream of values by applying a mapper function that returns an
Optionfor each input value. - traverse(Stream<A>, Function<? super A, Result<B, E>>) - Static method in interface codes.domix.fun.Result
-
Maps each element of a stream through
mapperand collects the results into aResult<List<B>, E>. - traverse(Stream<A>, Function<? super A, Try<B>>) - Static method in interface codes.domix.fun.Try
-
Maps each element of a stream through
mapperand collects the results into aTry<List<B>>. - Try<Value> - Interface in codes.domix.fun
-
A monadic type that represents a computation that may either result in a value (
Try.Success) or throw an exception (Try.Failure). - Try.CheckedRunnable - Interface in codes.domix.fun
-
Functional interface for runnables that can throw checked exceptions.
- Try.CheckedSupplier<T> - Interface in codes.domix.fun
-
A functional interface representing a supplier that can produce a value and may throw a checked exception.
- Try.Failure<Value> - Record Class in codes.domix.fun
-
Represents a computational failure within a context that implements the
Tryinterface. - Try.Success<Value> - Record Class in codes.domix.fun
-
Represents a successful computation result within the Try monad pattern.
- Tuple2<A,
B> - Record Class in codes.domix.fun -
An immutable tuple holding two values of potentially different types.
- Tuple2(A, B) - Constructor for record class codes.domix.fun.Tuple2
-
Creates an instance of a
Tuple2record class.
V
- value() - Method in record class codes.domix.fun.Option.Some
-
Returns the value of the
valuerecord component. - value() - Method in record class codes.domix.fun.Result.Ok
-
Returns the value of the
valuerecord component. - value() - Method in record class codes.domix.fun.Try.Success
-
Returns the value of the
valuerecord component.
Z
- zip(Option<? extends A>, Option<? extends B>) - Static method in interface codes.domix.fun.Option
- zip(Option<? extends B>) - Method in interface codes.domix.fun.Option
-
Combines the current
Optioninstance with anotherOptioninstance into a singleOptioncontaining aTuple2of their values, if both options are non-empty. - zipWith(Option<? extends B>, BiFunction<? super Value, ? super B, ? extends R>) - Method in interface codes.domix.fun.Option
-
Combines the values of this Option with the values of another Option using a provided combining function.
_
- _1() - Method in record class codes.domix.fun.Tuple2
-
Returns the value of the
_1record component. - _2() - Method in record class codes.domix.fun.Tuple2
-
Returns the value of the
_2record component.
All Classes and Interfaces|All Packages
Result.err(Object)with an explicit type witness or a typed variable instead:Result.<Value, Error>err(error)orResult<Value, Error> r = Result.err(error)