maybe

A monadic wrapper with a type-safe API to handle throwing operations in a functional way

APACHE-2.0 License

Stars
12

Bot releases are hidden (Show)

maybe - v3.2.0

Published by JoseLion over 1 year ago

3.2.0 (2023-06-04)

Bug Fixes

Features

  • deps: Update dependencies 2023.06.04 (#188) (607cd67)
maybe - v3.1.0

Published by JoseLion almost 2 years ago

3.1.0 (2023-01-13)

Features

  • core: Update Java, Grandle, and dependencies (#186) (f432c94)
maybe - v3.0.0

Published by JoseLion over 2 years ago

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 use 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.
  • 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 to Throwing*.java
    • For example, 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

maybe - v2.1.1

Published by JoseLion over 2 years ago

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
maybe - v2.1.0

Published by JoseLion over 2 years ago

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
maybe - v2.0.0

Published 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.

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(..)
  • Refactor ResolveHandler methods:
    • Rename .orDefault(..).orElse(..)
    • Add .orElse(..) overload with mapper Function<E, T>
    • Add .orElse(..) overload with supplying Supplier<T>
  • Refactor EffectHandler methods:
    • Rename onErrorThrow(..).orThrow(..)
    • Add .orElse(..) with Consumer<E>
    • Add .orElse(..) with Runnable
  • Refactor error handling of ResolveHandler:
    • Remove .onError(..)
      • Is the same as the new .orElse(mapper) plus the new .catchError(..) overloads
    • Add .catchError(..) overload matching specific type, with Supplier<T>
    • Add .catchError(..) overload without spec type, with Function<E, T>
    • Add .catchError(..) overload without specific type, with Supplier<T>
    • Add .doOnError(..) overload matching specific type, with Consumer<E>
    • Add .doOnError(..) overload matching specific type, with Runnable
    • Add .doOnError(..) overload without specific type, with Runnable
  • Refactor error handling of EffectHandler:
    • Fix .doOnError(..) to not recover from the error
    • Add .doOnError(..) overload without specific type, with Runnable
    • Add .doOnError(..) overload matching specific type, with Consumer<X>
    • Add .doOnError(..) overload matching specific type, with Runnable
    • Add .catchError(..) overload matching specific type, with Runnable
    • Add .catchError(..) overload without specific type, with Consumer<E>
    • Add .catchError(..) overload without specific type, with Runnable

New features

  • Add .doOnSuccess(..) operator to both ResolveHandler and EffectHandler
  • Add partial implementation overloads to .fromResolver(..) and .fromEffect(..)
  • Add .resolve(..) to the ResolveHandler with 2 overloads:
    • Map and ignore any possible error
    • Unwrap-like mapper: Two mappers, one for success another for error
  • Add .fromOptional(..) static creator
maybe - v1.6.0

Published by JoseLion about 3 years ago

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
maybe - Release v1.5.0

Published by JoseLion over 3 years ago

This release adds 5 commits on Mar 14

  • @JoseLion | Update documentation (#117) | 24b272b
  • @JoseLion | Rename Maybe success field to value (#118) | 848df33
  • @JoseLion | Add ResolveHandler mapper (#119) | 5ff659e
  • @JoseLion | Add ResolveHandler filter (#120) | b5694b6
  • @JoseLion | Bump to v1.5.0 (#121) | 364ee4d
Package Rankings
Top 42.46% on Repo1.maven.org
Badges
Extracted from project README
CI CodeQL Release Pages Maven Central javadoc codecov License Known Vulnerabilities Maven Central