Releases: JoseLion/maybe
v3.3.1
v3.3.0
v3.2.0
v3.1.0
v3.0.0
This is a major release which comes with some breaking changes:
⚠️ IMPORTANT: Due to changes on GitHub policies (and by consequence on Maven), it's no longer allowed to usecom.github
as a valid group ID prefix. To honor that and maintain consistency, as of v3, the artifact ID is nowio.github.joselion.maybe
. If you want to use a version before v3, you can still find it using the IDcom.github.joselion.maybe
.- A
ResolveHandler
can no longer be empty. It either has the resolved value or an error. - The method
ResolveHandler#filter
was removed to avoid the posibility of an inconsitent empty handler. - The
WrapperException
type was removed. Errors now propagate downstream with the API. - The method
EffectHandler#toMaybe
was removed as it didn't make sense for effects. - All
*Checked.java
functions were renamed toThrowing*.java
- For example,
FunctionChecked<T, R, E>
was renamed toThrowingFunction<T, R, E>
- For example,
@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
v2.1.1
This release adds a bug fix and a few chores:
- @JoseLion | [Docs] Updates for v2.1.0 (#158) | 4ce2af0
- @JoseLion | chore(deps): Update dependencies 12.06.22 (#160) | e61cfc3
- @JoseLion | chore(gradle): Update Gradle to v7.4.2 (#161) | 86f1dd2
- @JoseLion | fix(resource-holder): Error propagation on ResourceHolder (#159) | 578056d
- @JoseLion | chore(circleci): Improve the JVM installation (#162) | ee73df4
- @JoseLion | chore(version): Bump to v2.1.1 (#163) | 23d7176
v2.1.0
This release includes some fixes and iterations for v2.0.0
, along with some extra features:
- Rename
.orElse(Supplier)
overload to.OrElseGet(Supplier)
to prevent ambiguity - Add
.orNull()
terminal operator to prevent ambiguity on.orElse(null)
- Fix ambiguity issues:
- Rename
.fromResolver(FunctionChecked)
→.partialResolver(FunctionChecked)
- Rename
.fromEffect(ConsumerChecked)
→.partialEffect(ConsumerChecked)
- Remove potentially ambiguous overloads:
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)
- Add
.runEffect(..)
operators to both handlers
v2.0.0
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.
Breaking changes
- Checked functional interfaces methods should have matching names as their non-checked counterparts to allow interoperability with other APIs
- Rename Maybe methods:
- Rename
.resolve(..)
→.fromResolver(..)
- Rename
thenResolve(..)
→.resolve(..)
- Rename
.runEffect(..)
→.fromEffect(..)
- Rename
.thenRunEffect(..)
→.runEffect(..)
- Rename
- Refactor
ResolveHandler
methods:- Rename
.orDefault(..)
→.orElse(..)
- Add
.orElse(..)
overload with mapperFunction<E, T>
- Add
.orElse(..)
overload with supplyingSupplier<T>
- Rename
- Refactor
EffectHandler
methods:- Rename
onErrorThrow(..)
→.orThrow(..)
- Add
.orElse(..)
withConsumer<E>
- Add
.orElse(..)
withRunnable
- Rename
- Refactor error handling of
ResolveHandler
:- Remove
.onError(..)
- Is the same as the new
.orElse(mapper)
plus the new.catchError(..)
overloads
- Is the same as the new
- Add
.catchError(..)
overload matching specific type, withSupplier<T>
- Add
.catchError(..)
overload without spec type, withFunction<E, T>
- Add
.catchError(..)
overload without specific type, withSupplier<T>
- Add
.doOnError(..)
overload matching specific type, withConsumer<E>
- Add
.doOnError(..)
overload matching specific type, withRunnable
- Add
.doOnError(..)
overload without specific type, withRunnable
- Remove
- Refactor error handling of
EffectHandler
:- Fix
.doOnError(..)
to not recover from the error - Add
.doOnError(..)
overload without specific type, withRunnable
- Add
.doOnError(..)
overload matching specific type, withConsumer<X>
- Add
.doOnError(..)
overload matching specific type, withRunnable
- Add
.catchError(..)
overload matching specific type, withRunnable
- Add
.catchError(..)
overload without specific type, withConsumer<E>
- Add
.catchError(..)
overload without specific type, withRunnable
- Fix
New features
- Add
.doOnSuccess(..)
operator to bothResolveHandler
andEffectHandler
- Add partial implementation overloads to
.fromResolver(..)
and.fromEffect(..)
- Add
.resolve(..)
to theResolveHandler
with 2 overloads:- Map and ignore any possible error
- Unwrap-like mapper: Two mappers, one for success another for error
- Add
.fromOptional(..)
static creator
v1.6.0
This release adds 7 commits on Oct 07
- @JoseLion | Add ResolveHandler cast (#123) | 64afb66
- @JoseLion | Upgrade Gradle wrapper to v7.2 (#124) | e299bb5
- @JoseLion | Update dependencies (#125) | de23e4f
- @JoseLion | Update plugins (#126) | b4776db
- @brianwyka | Add orSupplyDefault method to ResolveHandler (#127) | 7eadd49
- @JoseLion | General polishing (#129) | c565952
- @JoseLion | Bump to v1.6.0 (#130) | fa0e367
Release v1.5.0
This release adds 5 commits on Mar 14