类 Pair<A,B>

java.lang.Object
com.intellij.openapi.util.Pair<A,B>
直接已知子类:
Couple, Pair.NonNull

public class Pair<A,B> extends Object
Generic wrapper around two related values.
  • 字段详细资料

    • first

      public final A first
    • second

      public final B second
  • 构造器详细资料

  • 方法详细资料

    • create

      @NotNull public static <A, B> @NotNull Pair<A,B> create(A first, B second)
    • createNonNull

      @NotNull public static <A, B> @NotNull Pair.NonNull<A,B> createNonNull(@NotNull A first, @NotNull B second)
    • pair

      @NotNull public static <A, B> @NotNull Pair<A,B> pair(A first, B second)
    • createFunction

      @NotNull public static <A, B> @NotNull Function<A,Pair<A,B>> createFunction(B value)
    • getFirst

      public static <T> T getFirst(@Nullable @Nullable Pair<T,?> pair)
    • getSecond

      public static <T> T getSecond(@Nullable @Nullable Pair<?,T> pair)
    • empty

      @NotNull public static <A, B> @NotNull Pair<A,B> empty()
    • getFirst

      public final A getFirst()
    • getSecond

      public final B getSecond()
    • equals

      public final boolean equals(Object o)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • comparingByFirst

      public static <A extends Comparable<? super A>, B> Comparator<Pair<A,B>> comparingByFirst()
      类型参数:
      A - first value type (Comparable)
      B - second value type
      返回:
      comparator that compares pair values by first value
    • comparingBySecond

      public static <A, B extends Comparable<? super B>> Comparator<Pair<A,B>> comparingBySecond()
      类型参数:
      A - first value type
      B - second value type (Comparable)
      返回:
      comparator that compares pair values by second value