Package org.jboss.marshalling
Class Pair<A,B>
- java.lang.Object
-
- org.jboss.marshalling.Pair<A,B>
-
- Type Parameters:
A- the first value typeB- the second value type
- All Implemented Interfaces:
Serializable
@Externalize(Externalizer.class) public final class Pair<A,B> extends Object implements Serializable
A serializable pair of values. There is also a specified externalizer as well, to support more efficient I/O.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPair.ExternalizerAn externalizer forPairinstances.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <A,B>
Pair<A,B>create(A a, B b)Create a new instance.booleanequals(Object other)Determine if this pair equals another.booleanequals(Pair<?,?> other)Determine if this pair equals another.AgetA()Get the first value.BgetB()Get the second value.inthashCode()Return the combined hash code of the two argument objects.StringtoString()Get a string representation of this pair.
-
-
-
Method Detail
-
getA
public A getA()
Get the first value.- Returns:
- the first value
-
getB
public B getB()
Get the second value.- Returns:
- the second value
-
hashCode
public int hashCode()
Return the combined hash code of the two argument objects.
-
equals
public boolean equals(Object other)
Determine if this pair equals another. A pair is equal to another pair if both members are equal.
-
equals
public boolean equals(Pair<?,?> other)
Determine if this pair equals another. A pair is equal to another pair if both members are equal.- Parameters:
other- the other pair- Returns:
trueif they are equal,falseotherwise
-
toString
public String toString()
Get a string representation of this pair.
-
create
public static <A,B> Pair<A,B> create(A a, B b)
Create a new instance.- Type Parameters:
A- the first value typeB- the second value type- Parameters:
a- the first valueb- the second value- Returns:
- the new instance
-
-