A C D E F G H I J L M N O P R T U W
All Classes All Packages
All Classes All Packages
All Classes All Packages
A
- accept(T) - Method in interface io.github.joselion.maybe.util.function.ThrowingConsumer
-
Accepts this function with the given argument, or throws an exception.
- apply(T) - Method in interface io.github.joselion.maybe.util.function.ThrowingFunction
-
Applies this function to the given argument, or throws an exception.
C
- cast(Class<U>) - Method in class io.github.joselion.maybe.Maybe
-
If the value is present, cast the value to another type.
- cast(Class<U>) - Method in class io.github.joselion.maybe.ResolveHandler
-
If the value is present, cast the value to anoter type.
- catchError(Class<X>, Consumer<X>) - Method in class io.github.joselion.maybe.EffectHandler
-
Catch the error if present and if it's instance of the provided type.
- catchError(Class<X>, Function<X, T>) - Method in class io.github.joselion.maybe.ResolveHandler
-
Catch the error if is present and is an instance of the provided type.
- catchError(Consumer<E>) - Method in class io.github.joselion.maybe.EffectHandler
-
Catch the error if is present.
- catchError(Function<E, T>) - Method in class io.github.joselion.maybe.ResolveHandler
-
Catch the error if is present and handle it to return a new value.
D
- doOnError(Class<X>, Consumer<X>) - Method in class io.github.joselion.maybe.EffectHandler
-
Run an effect if the error is present and is an instance of the provided type.
- doOnError(Class<X>, Consumer<X>) - Method in class io.github.joselion.maybe.ResolveHandler
-
Run an effect if the error is present and is an instance of the provided type.
- doOnError(Consumer<E>) - Method in class io.github.joselion.maybe.EffectHandler
-
Run an effect if the error is present.
- doOnError(Consumer<E>) - Method in class io.github.joselion.maybe.ResolveHandler
-
Run an effect if the error is present.
- doOnLeft(Consumer<L>) - Method in interface io.github.joselion.maybe.util.Either
-
Run an effect if the
Leftvalue is present. - doOnLeft(Consumer<L>) - Method in class io.github.joselion.maybe.util.Either.Left
- doOnLeft(Consumer<L>) - Method in class io.github.joselion.maybe.util.Either.Right
- doOnRight(Consumer<R>) - Method in interface io.github.joselion.maybe.util.Either
-
Run an effect if the
Rightvalue is present. - doOnRight(Consumer<R>) - Method in class io.github.joselion.maybe.util.Either.Left
- doOnRight(Consumer<R>) - Method in class io.github.joselion.maybe.util.Either.Right
- doOnSuccess(Runnable) - Method in class io.github.joselion.maybe.EffectHandler
-
Runs an effect if the operation succeeds.
- doOnSuccess(Consumer<T>) - Method in class io.github.joselion.maybe.ResolveHandler
-
Run an effect if the operation resolved successfully.
E
- EffectHandler<E extends java.lang.Throwable> - Class in io.github.joselion.maybe
-
EffectHandler is an API to handle the posible error of a
Maybe's effect operation. - Either<L,R> - Interface in io.github.joselion.maybe.util
-
Either is a monadic wrapper that contains one of two possible values which are represented as
LeftorRight. - Either.Left<L,R> - Class in io.github.joselion.maybe.util
-
The
Leftimplementation ofEither - Either.Right<L,R> - Class in io.github.joselion.maybe.util
-
The
Rightimplementation ofEither - equals(Object) - Method in class io.github.joselion.maybe.Maybe
-
Checks if some other object is equal to this
Maybe. - equals(Object) - Method in class io.github.joselion.maybe.util.Either.Left
- equals(Object) - Method in class io.github.joselion.maybe.util.Either.Right
F
- flatMap(Function<T, Maybe<U>>) - Method in class io.github.joselion.maybe.Maybe
-
If present, maps the value to another using the provided mapper function.
- fromEffect(ThrowingRunnable<E>) - Static method in class io.github.joselion.maybe.Maybe
-
Runs an effect that may throw an exception using a
ThrowingRunnableexpression. - fromOptional(Optional<T>) - Static method in class io.github.joselion.maybe.Maybe
-
Creates a
Maybewrapper of the given value if the optional is not empty. - fromResolver(ThrowingSupplier<T, E>) - Static method in class io.github.joselion.maybe.Maybe
-
Resolves the value of a throwing operation using a
ThrowingSupplierexpression.
G
- get() - Method in interface io.github.joselion.maybe.util.function.ThrowingSupplier
-
Gets a result or throws an exception.
H
- hashCode() - Method in class io.github.joselion.maybe.Maybe
-
Returns the hash code of the value, if present, otherwise
0(zero) if no value is present. - hashCode() - Method in class io.github.joselion.maybe.util.Either.Left
- hashCode() - Method in class io.github.joselion.maybe.util.Either.Right
- hasNothing() - Method in class io.github.joselion.maybe.Maybe
-
Checks if the
Maybehas nothing. - hasValue() - Method in class io.github.joselion.maybe.Maybe
-
Checks if the
Maybehas a value.
I
- identity() - Static method in interface io.github.joselion.maybe.util.function.ThrowingFunction
-
Returns a function that always returns its input argument.
- io.github.joselion.maybe - package io.github.joselion.maybe
-
This package is checked for
nullby the following annotations: org.eclipse.jdt.annotation.NonNullByDefault - io.github.joselion.maybe.util - package io.github.joselion.maybe.util
-
This package is checked for
nullby the following annotations: org.eclipse.jdt.annotation.NonNullByDefault - io.github.joselion.maybe.util.function - package io.github.joselion.maybe.util.function
-
This package is checked for
nullby the following annotations: org.eclipse.jdt.annotation.NonNullByDefault - isLeft() - Method in interface io.github.joselion.maybe.util.Either
-
Returns true if the
Leftvalue is present, false otherwise. - isLeft() - Method in class io.github.joselion.maybe.util.Either.Left
- isLeft() - Method in class io.github.joselion.maybe.util.Either.Right
- isRight() - Method in interface io.github.joselion.maybe.util.Either
-
Returns true if the
Rightvalue is present, false otherwise. - isRight() - Method in class io.github.joselion.maybe.util.Either.Left
- isRight() - Method in class io.github.joselion.maybe.util.Either.Right
J
- just(T) - Static method in class io.github.joselion.maybe.Maybe
-
Creates a
Maybewrapper of the given value.
L
- leftOrElse(L) - Method in class io.github.joselion.maybe.util.Either.Left
- leftOrElse(L) - Method in interface io.github.joselion.maybe.util.Either
-
Terminal operator.
- leftOrElse(L) - Method in class io.github.joselion.maybe.util.Either.Right
- leftOrNull() - Method in interface io.github.joselion.maybe.util.Either
-
Terminal operator.
- leftToOptional() - Method in interface io.github.joselion.maybe.util.Either
-
Terminal operator.
M
- map(Function<T, U>) - Method in class io.github.joselion.maybe.Maybe
-
If present, maps the value to another using the provided mapper function.
- map(Function<T, U>) - Method in class io.github.joselion.maybe.ResolveHandler
-
If the value is present, map it to another value through the
mapperfunction. - mapLeft(Function<L, T>) - Method in class io.github.joselion.maybe.util.Either.Left
- mapLeft(Function<L, T>) - Method in interface io.github.joselion.maybe.util.Either
-
Map the
Leftvalue to another if present. - mapLeft(Function<L, T>) - Method in class io.github.joselion.maybe.util.Either.Right
- mapRight(Function<R, T>) - Method in class io.github.joselion.maybe.util.Either.Left
- mapRight(Function<R, T>) - Method in interface io.github.joselion.maybe.util.Either
-
Map the
Rightvalue to another if present. - mapRight(Function<R, T>) - Method in class io.github.joselion.maybe.util.Either.Right
- mapToResource(Function<T, R>) - Method in class io.github.joselion.maybe.ResolveHandler
-
Map the value to an
AutoCloseableresource to be use in either aresolveClosingor arunEffectClosingoperation, which will close the resource when it completes. - Maybe<T> - Class in io.github.joselion.maybe
-
Maybe is a monadic wrapper that may contain a value.
N
- nothing() - Static method in class io.github.joselion.maybe.Maybe
-
Creates a
Maybewrapper with nothing on it.
O
- ofLeft(L) - Static method in interface io.github.joselion.maybe.util.Either
-
Factory method to create an
Eitherinstance that contains aLeftvalue. - ofRight(R) - Static method in interface io.github.joselion.maybe.util.Either
-
Factory method to create an
Eitherinstance that contains aRightvalue. - orElse(Consumer<E>) - Method in class io.github.joselion.maybe.EffectHandler
-
Terminal operation to handle the error if present.
- orElse(Function<E, T>) - Method in class io.github.joselion.maybe.ResolveHandler
-
Returns the resolved value if present.
- orElse(T) - Method in class io.github.joselion.maybe.ResolveHandler
-
Returns the resolved value if present.
- orElseGet(Supplier<T>) - Method in class io.github.joselion.maybe.ResolveHandler
-
Returns the resolved value if present.
- orNull() - Method in class io.github.joselion.maybe.ResolveHandler
-
Returns the resolved value if present.
- orThrow() - Method in class io.github.joselion.maybe.EffectHandler
-
Throws the error if present.
- orThrow() - Method in class io.github.joselion.maybe.ResolveHandler
-
Returns the resolved value if present.
- orThrow(Function<E, X>) - Method in class io.github.joselion.maybe.EffectHandler
-
If an error is present, map the error to another exception and throw it.
- orThrow(Function<E, X>) - Method in class io.github.joselion.maybe.ResolveHandler
-
Returns the value resolved/handled if present.
P
- partialEffect(ThrowingConsumer<S, E>) - Static method in class io.github.joselion.maybe.Maybe
-
Convenience partial application of an
effect. - partialResolver(ThrowingFunction<S, T, E>) - Static method in class io.github.joselion.maybe.Maybe
-
Convenience partial application of a
resolver.
R
- resolve(ThrowingFunction<T, S, X>) - Method in class io.github.joselion.maybe.ResolveHandler
-
Chain another resolver function if the value was resolved.
- resolve(ThrowingFunction<T, S, X>, ThrowingFunction<E, S, X>) - Method in class io.github.joselion.maybe.ResolveHandler
-
Chain another resolver covering both cases of success or error of the previous resolver in two different callbacks.
- resolve(ThrowingFunction<T, U, E>) - Method in class io.github.joselion.maybe.Maybe
-
Chain the
Maybewith another resolver, if and only if the previous operation was handled with no errors. - resolveClosing(ThrowingFunction<R, T, X>) - Method in class io.github.joselion.maybe.ResourceHolder
-
If the resource is present, resolves the value of a throwing operation using a
ThrowingFunctionexpression which has the previously prepared resource in the argument. - ResolveHandler<T,E extends java.lang.Throwable> - Class in io.github.joselion.maybe
-
ResolveHandler is an API to handle the possible error of a
Maybe's resolve operation. - ResourceHolder<R extends java.lang.AutoCloseable,E extends java.lang.Throwable> - Class in io.github.joselion.maybe
-
ResourceHolder is a "middle step" API that allows to resolve or run an effect using a previously passed
AutoCloseableresource. - rightOrElse(R) - Method in class io.github.joselion.maybe.util.Either.Left
- rightOrElse(R) - Method in class io.github.joselion.maybe.util.Either.Right
- rightOrElse(R) - Method in interface io.github.joselion.maybe.util.Either
-
Terminal operator.
- rightOrNull() - Method in interface io.github.joselion.maybe.util.Either
-
Terminal operator.
- rightToOptional() - Method in interface io.github.joselion.maybe.util.Either
-
Terminal operator.
- run() - Method in interface io.github.joselion.maybe.util.function.ThrowingRunnable
-
Runs the operation, or throws an exception.
- runEffect(ThrowingConsumer<T, E>) - Method in class io.github.joselion.maybe.Maybe
-
Chain the
Maybewith another effect, if and only if the previous operation was handled with no errors. - runEffect(ThrowingConsumer<T, X>) - Method in class io.github.joselion.maybe.ResolveHandler
-
Chain the previous operation to an effect if the value was resolved.
- runEffect(ThrowingConsumer<T, X>, ThrowingConsumer<E, X>) - Method in class io.github.joselion.maybe.ResolveHandler
-
Chain the previous operation to an effect covering both the success or error cases in two different callbacks.
- runEffect(ThrowingRunnable<X>) - Method in class io.github.joselion.maybe.EffectHandler
-
Chain another effect if the previous completed with no error.
- runEffect(ThrowingRunnable<X>, ThrowingConsumer<E, X>) - Method in class io.github.joselion.maybe.EffectHandler
-
Chain another effect covering both cases of success or error of the previous effect in two different callbacks.
- runEffectClosing(ThrowingConsumer<R, X>) - Method in class io.github.joselion.maybe.ResourceHolder
-
If the resource is present, runs an effect that may throw an exception using a
ThrowingConsumerexpression which has the previously prepared resource in the argument.
T
- ThrowingConsumer<T,E extends java.lang.Throwable> - Interface in io.github.joselion.maybe.util.function
-
The same as
Consumer, but the lambda expression throws anEchecked exception. - ThrowingFunction<T,R,E extends java.lang.Throwable> - Interface in io.github.joselion.maybe.util.function
-
The same as
Function, but the lambda expression throws anEchecked exception. - ThrowingRunnable<E extends java.lang.Throwable> - Interface in io.github.joselion.maybe.util.function
-
The same as
Runnable, but the lambda expression throws anEexception. - ThrowingSupplier<T,E extends java.lang.Throwable> - Interface in io.github.joselion.maybe.util.function
-
The same as
Supplier, but the lambda expression throws anEexception. - toEither() - Method in class io.github.joselion.maybe.ResolveHandler
-
Transforms the handler to an
Either, in which the left side might contain the error and the right side might contain the resolved value. - toMaybe() - Method in class io.github.joselion.maybe.ResolveHandler
-
Transforms the handler to a
Maybethat contains either the resolved value or the error. - toOptional() - Method in class io.github.joselion.maybe.Maybe
-
Safely unbox the value as an
Optionalwhich may or may not contain a value. - toOptional() - Method in class io.github.joselion.maybe.ResolveHandler
-
Transforms the handler to an
Optional. - toString() - Method in class io.github.joselion.maybe.Maybe
-
Returns a non-empty string representation of this
Maybesuitable for debugging. - toString() - Method in class io.github.joselion.maybe.util.Either.Left
- toString() - Method in class io.github.joselion.maybe.util.Either.Right
U
- unwrap(Function<L, T>, Function<R, T>) - Method in class io.github.joselion.maybe.util.Either.Left
- unwrap(Function<L, T>, Function<R, T>) - Method in class io.github.joselion.maybe.util.Either.Right
- unwrap(Function<L, T>, Function<R, T>) - Method in interface io.github.joselion.maybe.util.Either
-
Terminal operator.
W
- withResource(R) - Static method in class io.github.joselion.maybe.Maybe
-
Prepare an
AutoCloseableresource to use in a resolver or effect.
All Classes All Packages