A monadic wrapper with a type-safe API to handle throwing operations in a functional way
APACHE-2.0 License
Bot releases are hidden (Show)
Published by JoseLion over 2 years ago
This is a major release which comes with some breaking changes:
com.github
as a valid group ID prefix. To honor that and maintain consistency, as of v3, the artifact ID is now io.github.joselion.maybe
. If you want to use a version before v3, you can still find it using the ID com.github.joselion.maybe
.ResolveHandler
can no longer be empty. It either has the resolved value or an error.ResolveHandler#filter
was removed to avoid the posibility of an inconsitent empty handler.WrapperException
type was removed. Errors now propagate downstream with the API.EffectHandler#toMaybe
was removed as it didn't make sense for effects.*Checked.java
functions were renamed to Throwing*.java
FunctionChecked<T, R, E>
was renamed to ThrowingFunction<T, R, E>
@JoseLion | chore(version): Bump to v3.0.0 (#165) | 2544ba4
@JoseLion | chore(maven): Move to io.github group ID prefix (#166) | ee09522
@JoseLion | chore(jdk): Move to Java 18 (#167) | 9e2b4e4
@JoseLion | chore(sonatype): Fix Sonatype publication (#168) | 4f0f170
@JoseLion | perf(functions): Rename Checked.java functions to Throwing.java (#169) | bef1e84
@JoseLion | feat(Either): Implement Either<L, R> data type (#170) | dcd3664
@JoseLion | feat(resolver): Refactor ResolveHandler to use Either<E, T> (#171) | 15e896e
@JoseLion | chore(cleanup): Remove WrappingException (#172) | d2e8a47
@JoseLion | feat(resolve-handler): Add .toEither() operator (#173) | 1781883
@JoseLion | docs: Updates for v3 (#174) | ffa01ff
Published by JoseLion over 2 years ago
This release adds a bug fix and a few chores:
Published by JoseLion over 2 years ago
This release includes some fixes and iterations for v2.0.0
, along with some extra features:
.orElse(Supplier)
overload to .OrElseGet(Supplier)
to prevent ambiguity.orNull()
terminal operator to prevent ambiguity on .orElse(null)
.fromResolver(FunctionChecked)
→ .partialResolver(FunctionChecked)
.fromEffect(ConsumerChecked)
→ .partialEffect(ConsumerChecked)
ResolveHandler#doOnSuccess(Runnable)
ResolveHandler#doOnError(Class, Runnable)
ResolveHandler#doOnError(Runnable)
ResolveHandler#catchError(Class, Supplier)
ResolveHandler#catchError(Supplier)
EffectHandler#doOnError(Class, Runnable)
EffectHandler#doOnError(Runnable)
EffectHandler#catchError(Class, Runnable)
EffectHandler#catchError(Runnable)
EffectHandler#orElse(Runnable)
.runEffect(..)
operators to both handlersPublished by JoseLion over 2 years ago
This major release brings some breaking changes and some exciting new features. Most breaking changes are caused by the renaming of methods in the API since this new version aims to make the API similar to Java's Optional<T>
. This way, developers will have an easier time remembering the API, plus providing better consistency across their code.
.resolve(..)
→ .fromResolver(..)
thenResolve(..)
→ .resolve(..)
.runEffect(..)
→ .fromEffect(..)
.thenRunEffect(..)
→ .runEffect(..)
ResolveHandler
methods:
.orDefault(..)
→ .orElse(..)
.orElse(..)
overload with mapper Function<E, T>
.orElse(..)
overload with supplying Supplier<T>
EffectHandler
methods:
onErrorThrow(..)
→ .orThrow(..)
.orElse(..)
with Consumer<E>
.orElse(..)
with Runnable
ResolveHandler
:
.onError(..)
.orElse(mapper)
plus the new .catchError(..)
overloads.catchError(..)
overload matching specific type, with Supplier<T>
.catchError(..)
overload without spec type, with Function<E, T>
.catchError(..)
overload without specific type, with Supplier<T>
.doOnError(..)
overload matching specific type, with Consumer<E>
.doOnError(..)
overload matching specific type, with Runnable
.doOnError(..)
overload without specific type, with Runnable
EffectHandler
:
.doOnError(..)
to not recover from the error.doOnError(..)
overload without specific type, with Runnable
.doOnError(..)
overload matching specific type, with Consumer<X>
.doOnError(..)
overload matching specific type, with Runnable
.catchError(..)
overload matching specific type, with Runnable
.catchError(..)
overload without specific type, with Consumer<E>
.catchError(..)
overload without specific type, with Runnable
.doOnSuccess(..)
operator to both ResolveHandler
and EffectHandler
.fromResolver(..)
and .fromEffect(..)
.resolve(..)
to the ResolveHandler
with 2 overloads:
.fromOptional(..)
static creatorPublished by JoseLion about 3 years ago
This release adds 7 commits on Oct 07
Published by JoseLion over 3 years ago
This release adds 5 commits on Mar 14