Awesome
<img align="left" src="durian.png"> Durian: Guava's spikier (unofficial) cousin
<!---freshmark shields output = [ link(shield('Maven artifact', 'mavenCentral', '{{group}}:{{name}}', 'blue'), 'https://bintray.com/{{org}}/opensource/{{name}}/view'), link(shield('Latest version', 'latest', '{{stable}}', 'blue'), 'https://github.com/{{org}}/{{name}}/releases/latest'), link(shield('Javadoc', 'javadoc', 'OK', 'blue'), 'https://{{org}}.github.io/{{name}}/javadoc/{{stable}}/'), link(shield('License Apache', 'license', 'Apache', 'blue'), 'https://tldrlegal.com/license/apache-license-2.0-(apache-2.0)'), '', link(shield('Changelog', 'changelog', '{{version}}', 'brightgreen'), 'CHANGES.md'), link(image('Travis CI', 'https://travis-ci.org/{{org}}/{{name}}.svg?branch=master'), 'https://travis-ci.org/{{org}}/{{name}}'), link(shield('Live chat', 'gitter', 'live chat', 'brightgreen'), 'https://gitter.im/diffplug/durian') ].join('\n'); --> <!---freshmark /shields -->Guava has become indispensable for many Java developers. Because of its wide adoption, it must be conservative regarding its minimum requirements.
<!---freshmark javadoc output = prefixDelimiterReplace(input, 'https://{{org}}.github.io/{{name}}/javadoc/', '/', stable); -->Durian complements Guava with some features which are too spiky for Guava, such as:
- One-liner exception handling for Java 8 functional interfaces (even with checked exceptions).
- A simple replacement for the mess of
PrintStream
,OutputStream
,Writer
, etc. when all you want is to pipe some strings around. - Given a node in a tree, and a
Function<Node, List<Node>>
, create aStream
for traversing this tree (breadth-first, depth-first, etc.). - An enum for handling comparisons in a pattern-matchey way.
- Guava's
Suppliers
,Predicates
, andFunctions
converted to Java 8, and a newConsumers
class to round it out. - A few other carefully-curated Java 8 goodies:
Durian's only requirement is Java 8 or greater, no other libraries are needed (not even Guava).
Contributions are welcome, see the contributing guide for development info.
Related
If you have a Box
, but you'd like to subscribe to changes in its value, you should look at RxBox
in DurianRx.
Acknowledgements
- The API and tests for
Suppliers
,Functions
, andPredicates
are all verbatim from Guava. StringPrinter.toOutputStream()
borrows heavily fromWriterOutputStream
, inside Apache commons-io.DurianPlugins
is inspired by RxJava's plugin mechanism.- Formatted by spotless, as such.
- Bugs found by findbugs, as such.
- OSGi metadata generated by goomph, which leverages Peter Kriens' bnd.
- Scripts in the
.ci
folder are inspired by Ben Limmer's work. - Built by gradle.
- Tested by junit.
- Maintained by DiffPlug.