Module qtjambi
Package io.qt.core

Class QPair<T,S>

java.lang.Object
io.qt.core.QPair<T,S>
All Implemented Interfaces:
Cloneable

public class QPair<T,S> extends Object implements Cloneable
QPair keeps two generic values accessible by first and second.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    First value of the pair.
    Second value of the pair.
  • Constructor Summary

    Constructors
    Constructor
    Description
    QPair(T t, S s)
    Constructs a pair.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a copy of this object.
    boolean
    Returns true if this pair is the same as the other pair.
    static <T, S> QPair<T,S>
    fromEntry(Map.Entry<T,S> entry)
    Convenient entry-pair converter method for new pair.
    int
     
    static <T, S> QPair<T,S>
    pair(T t, S s)
    Convenient factory method for new pair.
    static <T, S> Map.Entry<T,S>
    toEntry(QPair<T,S> pair)
    Convenient pair-entry converter method.
    Returns a string representation of this pair.

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • first

      public T first
      First value of the pair.
    • second

      public S second
      Second value of the pair.
  • Constructor Details

    • QPair

      public QPair(T t, S s)
      Constructs a pair.
      Parameters:
      t - The first parameter.
      s - The second parameter.
  • Method Details

    • equals

      @QtUninvokable public boolean equals(Object o)
      Returns true if this pair is the same as the other pair. If any of the first or second members are null the result is false regardless.
      Overrides:
      equals in class Object
      Parameters:
      o - The other parameter
      Returns:
      True if they are equal.
    • hashCode

      @QtUninvokable public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @QtUninvokable public String toString()
      Returns a string representation of this pair.
      Overrides:
      toString in class Object
    • clone

      @QtUninvokable public QPair<T,S> clone()
      Returns a copy of this object.
      Overrides:
      clone in class Object
    • pair

      @QtUninvokable public static <T, S> QPair<T,S> pair(T t, S s)
      Convenient factory method for new pair.
      Parameters:
      t -
      s -
      Returns:
      new pair
    • fromEntry

      @QtUninvokable public static <T, S> QPair<T,S> fromEntry(Map.Entry<T,S> entry)
      Convenient entry-pair converter method for new pair.
      Parameters:
      entry -
      Returns:
      new pair
    • toEntry

      @QtUninvokable public static <T, S> Map.Entry<T,S> toEntry(QPair<T,S> pair)
      Convenient pair-entry converter method.
      Parameters:
      pair -
      Returns:
      new entry