Interface Twin<T>

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 used to swap the elements of pair.

    Methods inherited from interface java.lang.Comparable


    Methods inherited from interface org.eclipse.collections.api.tuple.Pair

    getOne, getTwo, isEqual, isSame, put, toEntry
  • Method Details

    • swap

      Twin<T> swap()
      Description copied from interface: Pair
      Method used to swap the elements of pair.
       Pair<String, Integer> pair = Tuples.pair("One", 1);
       Pair<Integer, String> swappedPair = pair.swap();
      Specified by:
      swap in interface Pair<T,T>