Class ImmutablePair<L,R>

java.lang.Object
org.aoju.bus.core.lang.tuple.Pair<L,R>
org.aoju.bus.core.lang.tuple.ImmutablePair<L,R>
Type Parameters:
L - the left element type
R - the right element type
All Implemented Interfaces:
Serializable, Comparable<Pair<L,R>>, Map.Entry<L,R>

public final class ImmutablePair<L,R> extends Pair<L,R>

An immutable pair consisting of two Object elements.

Although the implementation is immutable, there is no restriction on the objects that may be stored. If mutable objects are stored in the pair, then the pair itself effectively becomes mutable. The class is also final, so a subclass can not add undesirable behaviour.

#ThreadSafe# if both paired objects are thread-safe

Since:
Java 17+
Author:
Kimi Liu
See Also: