Skip to content

Add functional interfaces IOFunction and IOSupplier#110

Merged
garydgregory merged 3 commits into
apache:masterfrom
adamretter:iostreams-sync-2
Apr 16, 2020
Merged

Add functional interfaces IOFunction and IOSupplier#110
garydgregory merged 3 commits into
apache:masterfrom
adamretter:iostreams-sync-2

Conversation

@adamretter

@adamretter adamretter commented Apr 8, 2020

Copy link
Copy Markdown
Contributor
  1. Adds IOFunction which it turns out I had already implemented in ByteArrayOutputStreamTestCase of Refactor ByteArrayOutputStream into synchronized and non-synchronized versions #108 .
  2. Adds IOSupplier.

These are designed to complement the existing IOConsumer class, and come with tests for 100% code coverage.

p.s. on a separate side-note... if you like these, I have a much larger library of Java Functional Interfaces that I wrote in the past that can work with exceptions here - https://github.com/adamretter/j8fu/tree/master/src/main/java/com/evolvedbinary/j8fu/function
Perhaps Apache commons would be interested in such a donation under a different scope?

@garydgregory

Copy link
Copy Markdown
Member

@adamretter Non-IO functional interfaces likely belong in Apache Commons Lang. Please have a look there.

@adamretter

Copy link
Copy Markdown
Contributor Author

@garydgregory Okay cool. This PR does add two functional interfaces which are IO related. Are you happy with that?

@garydgregory garydgregory changed the title Further functional interfaces Add functional interfaces IOFunction and IOSupplier Apr 16, 2020
@garydgregory garydgregory merged commit b739ce7 into apache:master Apr 16, 2020
brettlounsbury pushed a commit to brettlounsbury/commons-io that referenced this pull request May 28, 2020
* Fix a warning over generics

* Extract IOFunction from test case to be usable elsewhere. Complements IOConsumer

* Add IOSupplier to complement IOFunction and IOConsumer
brettlounsbury pushed a commit to brettlounsbury/commons-io that referenced this pull request May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants