Skip to content

ayte-io/java-utility-value

Repository files navigation

Ayte :: Utility :: Value

CircleCI Maven Central Code Climate maintainability Sonar Tech Debt

MIT License UPL-1.0 License

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.

Coordinates

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.

Usage

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.

Licensing

MIT / UPL-1.0

Ayte Labs, 2019

Do anything you want to

About

No description or website provided.

Topics

Resources

License

MIT, UPL-1.0 licenses found

Licenses found

MIT
LICENSE-MIT
UPL-1.0
LICENSE-UPL-1.0

Stars

Watchers

Forks

Packages

No packages published

Languages