Skip navigation links

Package de.scravy.pair

This package provides ordered pairs that consist of a first (left) and a second (right) component.

See: Description

Package de.scravy.pair Description

This package provides ordered pairs that consist of a first (left) and a second (right) component. There are four pair types defined as the following interfaces:

Instances of this classes can be created using the Pairs utility class. For every interface there is a static builder function:

All instances that can be created using this package are immutable and defining interfaces do not suggest setters/mutability. This is also the reason why the Pairs here do not extend Map.Entry (unlinke e.g. the Apache Commons Pair).

Motivation

Every know and then I found myself badly needing (wanting?) a Pair. A lot of libraries ship with either their own definition of a pair or pull in other libraries that provide one. But why should I use yet-another-utility-belt (most probably in addition to the one I already pulled in) just for having a Pair class when I do not need anything else from it?

Since:
1.0.0
Author:
Julian Fleischer
Skip navigation links

Copyright © 2015. All rights reserved.