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.
#ThreadSafe# if both paired objects are thread-safe
| Modifier and Type | Field and Description |
|---|---|
| public static final ImmutablePair | EMPTY_ARRAY
An empty array.
|
| public final L | left
Left object |
| private static final ImmutablePair | NULL
An immutable pair of nulls. |
| public final R | right
Right object |
| private static final long | serialVersionUID
Serialization version
|
| Access | Constructor and Description |
|---|---|
| public | ImmutablePair(final L
the left value, may be null left, final R the right value, may be null right)Create a new pair instance. |
| Modifier and Type | Method and Description |
|---|---|
| public static < the left element type L, the right element type R> ImmutablePair | Returns: the empty array singleton that can be assigned without compiler warning.Hides org. Returns the empty array singleton that can be assigned without compiler warning. |
| public L | getLeft()
Implements abstract org. Gets the left element from this pair. |
| public R | getRight()
Implements abstract org. Gets the right element from this pair. |
| public static < the left element type. L, the right element type. R> Pair | Returns: an immutable formed from the two parameters, not null.the left element, may be null. left)Creates an immutable pair of two objects inferring the generic types. |
| public static < the left element of this pair. Value is L, null.the right element of this pair. Value is R> ImmutablePairnull. | |
| public static < the left element type. L, the right element type. R> ImmutablePair | Returns: an immutable formed from the two parameters, not null.the left element, may be null. left, final R the right element, may be null. right)Hides org. Creates an immutable pair of two objects inferring the generic types. |
| public static < the left element type. L, the right element type. R> ImmutablePair | Returns: an immutable formed from the map entry.the existing map entry. pairHides org. Creates an immutable pair from a map entry. |
| public static < the left element type. L, the right element type. R> ImmutablePair | Returns: an immutable formed from the two parameters, not null.the left element, may not be null. left, final R the right element, may not be null. right)Hides org. Creates an immutable pair of two non-null objects inferring the generic types. |
| public static < the left element type. L, the right element type. R> Pair | Returns: an immutable formed from the two parameters, not null.the right element, may be null. right)Creates an immutable pair of two objects inferring the generic types. |
| public R | Returns: neverthe value to set value)Implements java. Throws |
| EMPTY_ARRAY | back to summary |
|---|---|
| public static final ImmutablePair<?, ?>[] EMPTY_ARRAY Hides org. An empty array.
Consider using
| |
| left | back to summary |
|---|---|
| public final L left Left object | |
| NULL | back to summary |
|---|---|
| private static final ImmutablePair<L, R> NULL An immutable pair of nulls.
| |
| right | back to summary |
|---|---|
| public final R right Right object | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. Serialization version | |
| ImmutablePair | back to summary |
|---|---|
| public ImmutablePair(final L left, final R right) Create a new pair instance.
| |
| emptyArray | back to summary |
|---|---|
| public static <L, R> ImmutablePair Hides org. Returns the empty array singleton that can be assigned without compiler warning.
| |
| getLeft | back to summary |
|---|---|
| public L getLeft() Implements abstract org. Doc from org. Gets the left element from this pair. When treated as a key-value pair, this is the key.
| |
| getRight | back to summary |
|---|---|
| public R getRight() Implements abstract org. Doc from org. Gets the right element from this pair. When treated as a key-value pair, this is the value.
| |
| left | back to summary |
|---|---|
| public static <L, R> Pair Creates an immutable pair of two objects inferring the generic types.
| |
| nullPair | back to summary |
|---|---|
| public static <L, R> ImmutablePair Returns an immutable pair of nulls.
| |
| of | back to summary |
|---|---|
| public static <L, R> ImmutablePair Hides org. Creates an immutable pair of two objects inferring the generic types.
| |
| of | back to summary |
|---|---|
| public static <L, R> ImmutablePair Hides org. Creates an immutable pair from a map entry.
| |
| ofNonNull | back to summary |
|---|---|
| public static <L, R> ImmutablePair Hides org. Creates an immutable pair of two non-null objects inferring the generic types.
| |
| right | back to summary |
|---|---|
| public static <L, R> Pair Creates an immutable pair of two objects inferring the generic types.
| |
| setValue | back to summary |
|---|---|
| public R setValue(final R value) Implements java. Throws This pair is immutable, so this operation is not supported.
| |