This project contains utility value classes that are commonly used (Pair, Trio, etc.) and helper classes with static methods to reduce common boilerplate.
See utility project for better understanding.
Project comes in two packages: API (just interfaces) and kit (actual
implementations), Their coordinates are
io.ayte.utility.value:api
and
io.ayte.utility.value:kit
respectively.
Project is both java 8 compatible and exposes
io.ayte.utility.value.api
and io.ayte.utility.value.kit
modules.
Project exposes basic Pair
and Trio
interfaces for two- and
three-argument containers with basic getters, as well as AmplePair
and
AmpleTrio
, which contain setters and extra transformation methods. Kit
exposes mutable and immutable interface implementations, with Pairs
and Trios
utility classes:
AmpleTrio<Integer, Integer, Integer> alpha = Trios.immutable(1, 2, 3);
AmpleTrio<Integer, Double, Integer> beta = alpha.mapSecond(x -> 1.0 / x);
AmpleTrio<Integer, Double, Boolean> gamma = beta.withThird(true);
AmpleTrio<Boolean, Integer, Double> delta = gamma.rollForward();
AmpleTrio<Double, Integer, Boolean> epsilon = delta.reverse();
The actual difference between mutable and immutable implementations is
only in setX
methods, all other methods produce new instances.
MIT / UPL-1.0
Ayte Labs, 2019
Do anything you want to