-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added OneOf5. A second-class Union Type like OneOf4, but with one m…
…ore. - Removed OneOf2OrNone; use Option<OneOf2> instead. The [OneOf2OrNoneTest](src/test/java/org/organicdesign/fp/oneOf/OneOf2OrNoneTest.java) 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` lets subclasses access the contained item for easily implementing an interface that the possible values share. The [OneOf2Test](src/test/java/org/organicdesign/fp/oneOf/OneOf2Test.java) shows how. - Test coverage reached 95% by line.
- Loading branch information
1 parent
1ce6deb
commit 9367644
Showing
18 changed files
with
581 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 0 additions & 98 deletions
98
src/main/java/org/organicdesign/fp/oneOf/OneOf2OrNone.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.