Skip to content

OneOf5

Compare
Choose a tag to compare
@GlenKPeterson GlenKPeterson released this 21 Jan 15:59

Release 3.10.0 2022-01-21: "OneOf5"

  • Added OneOf5. A second-class Union Type like OneOf4, but with one more.
  • Removed OneOf2OrNone; use Option<OneOf2> instead.
    The OneOf2OrNoneTest shows how.
  • Changed the contained object in all OneOf_ classes from @Nullable to @NotNull and from private to protected.
    If you use @NotNull annotations in your subclass, you can now overload the static factory methods in your subclasses (you can use the same name for all of them).
    Instead of storing null in a OneOf_, simply return a null OneOf_ or Option<OneOf_>.none().
    The protected modifier now lets subclasses access the contained item for easily implementing an interface that the possible values share.
    The OneOf2Test shows how.
  • Test coverage reached 95% by line.