Class TwinImpl<T>

java.lang.Object
org.eclipse.collections.impl.tuple.PairImpl<T,T>
org.eclipse.collections.impl.tuple.TwinImpl<T>
All Implemented Interfaces:
Serializable, Comparable<Pair<T,T>>, Pair<T,T>, Twin<T>

final class TwinImpl<T> extends PairImpl<T,T> implements Twin<T>
A TwinImpl is a PairImpl that has the same type for both items. This is a convenience class
  • Field Details

  • Constructor Details

    • TwinImpl

      TwinImpl(T newOne, T newTwo)
  • Method Details

    • swap

      public TwinImpl<T> swap()
      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>
      Specified by:
      swap in interface Twin<T>
      Overrides:
      swap in class PairImpl<T,T>