类 Pair<A,B>
java.lang.Object
cn.taketoday.core.Pair<A,B>
- 类型参数:
A- type of the first value.B- type of the second value.
- 所有已实现的接口:
Serializable,Map.Entry<A,B>
Represents a generic pair of two values.
There is no meaning attached to values in this class, it can be used for any purpose.
Pair exhibits value semantics, i.e. two pairs are equal if both components are equal.
An example of decomposing it into values:
- 从以下版本开始:
- 4.0 2023/8/24 14:45
- 作者:
- Harry Yang
- 另请参阅:
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static <A extends Comparable<? super A>,B>
Comparator<Pair<A,B>> static <A,B extends Comparable<? super B>>
Comparator<Pair<A,B>> static <A,B> Pair<A, B> empty()booleanfirst()final AgetFirst()static <T> TgetKey()final Bstatic <T> TgetValue()inthashCode()static <A,B> Pair<A, B> of(A first, B second) second()toString()Returns string representation of the [Pair] including its [first] and [second] values.withSecond(B second)
-
字段详细资料
-
EMPTY
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
first
-
second
-
-
构造器详细资料
-
Pair
-
-
方法详细资料
-
getFirst
-
getSecond
-
getKey
-
getValue
-
setValue
-
withFirst
-
withSecond
-
first
-
second
-
equals
-
hashCode
public int hashCode() -
toString
Returns string representation of the [Pair] including its [first] and [second] values. -
empty
-
of
-
getFirst
-
getSecond
-
comparingFirst
- 类型参数:
A- first value type (Comparable)B- second value type- 返回:
- a comparator that compares pair values by first value
-
comparingSecond
- 类型参数:
A- first value typeB- second value type (Comparable)- 返回:
- a comparator that compares pair values by second value
-