- All Superinterfaces:
Comparable<Pair<T,T>>
, Pair<T,T>
, Serializable
public interface Twin<T>
extends Pair<T,T>
A Twin is a Pair where both elements have the same type.
An instance of this interface can be created by calling Tuples.twin(Object, Object).
-
Method Summary
Modifier and Type |
Method |
Description |
Twin<T> |
swap() |
Method used to swap the elements of pair.
|
-
Method Details
-
Description copied from interface: Pair
Method used to swap the elements of pair.
e.g.
Pair<String, Integer> pair = Tuples.pair("One", 1);
Pair<Integer, String> swappedPair = pair.swap();
- Specified by:
swap
in interface Pair<T,T>