|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.internal.util.collection.Tuples
public final class Tuples
Utility class with methods for working with tuples, such as Pair and
Ref.
| Method Summary | ||
|---|---|---|
static
|
emptyRef()
Constructs a new empty mutable Ref instance. |
|
static
|
immutableRef(T value)
Constructs a new immutable Ref instance referencing the given
input reference. |
|
static
|
of(L left,
R right)
Constructs Pair of the given values. |
|
static
|
of(T value)
Constructs a new mutable Ref instance referencing the given
input reference. |
|
static
|
swap(Pair<L,R> pair)
Constructs a new Pair instance with values of the input pair instance
swapped. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <L,R> Pair<L,R> of(L left,
R right)
Pair of the given values.
L - left-hand reference typeR - right-hand reference typeleft - left-hand reference in the pairright - right-hand reference in the pair
Pair of input valuesswap(Pair)public static <L,R> Pair<R,L> swap(Pair<L,R> pair)
Pair instance with values of the input pair instance
swapped.
L - left-hand reference typeR - right-hand reference typepair - instance whose values are to be swapped
Pair instance with values of the input pair instance
swapped.of(java.lang.Object, java.lang.Object)public static <T> Ref<T> of(T value)
Ref instance referencing the given
input reference.
T - type of the referenced instancevalue - reference of the newly constructed reference
Ref instance referencing the given
input reference.immutableRef(java.lang.Object),
emptyRef()public static <T> Ref<T> emptyRef()
Ref instance.
T - type of the referenced instance
Ref instanceimmutableRef(java.lang.Object),
of(java.lang.Object)public static <T> Ref<T> immutableRef(T value)
Ref instance referencing the given
input reference.
Invoking a Ref.set(java.lang.Object) on the returned instance
will result in a IllegalStateException being thrown.
T - type of the referenced instancevalue - reference of the newly constructed reference
Ref instance referencing the given
input reference.emptyRef(),
of(java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||