Introduction
This module is mostly composed of small utilities that lives on their own:
- As: a facility for supporing DCI roles;
- Finder: a fluent and flexible API to extract collection of objects from a source;
- Pair and Triple: the implementation of 2- and 3-tuples;
- Type-safe maps: an implementation of maps iInspired by the heterogeneous map pattern described in Effective Java by Joshua Bloch.
To use this module in your Maven project add this snippet to your POM:
<dependency>
<groupId>it.tidalwave.thesefoolishthings</groupId>
<artifactId>it-tidalwave-util</artifactId>
<version>5.0-ALPHA-2</version>
</dependency>
Snippets for other build tool (such as Gradle) are available here. The dependencies of this module are described here. Information about quality and continuous integration is available at the main project page.
Compatibility with Java 9 modules
This library is fully compatible with Java 9 modules. Since some parts of it use reflection to instantiate classes or inject them with dependencies (e.g.
Finder
and DCI roles), modules using these features need to be properly “opened”, such as in the following example:
module com.acme.mymodule
{
// ...
opens com.acme.mymodule.impl to it.tidalwave.util;
}
The packages in the opens
declaration are those containing the classes that need the reflective operations.
If this operation is not done, a runtime exception will occur; its message will explain which packages needsto be opened. More information about open modules and reflection is available in this Stack Overflow article.