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:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final A
private final B
private final int
private static final long
private static final FieldSetter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <A,
B> Pair <A, B> create
(A a, B b) Create a new instance.boolean
Determine if this pair equals another.boolean
Determine if this pair equals another.getA()
Get the first value.getB()
Get the second value.int
hashCode()
Return the combined hash code of the two argument objects.private static int
Calculate the combined hash code of two objects.private void
Reinitialize the object and set the hash code.toString()
Get a string representation of this pair.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
a
-
b
-
hashCode
private final transient int hashCode -
setter
-
-
Constructor Details
-
Pair
Create a new instance.- Parameters:
a
- the first valueb
- the second value
-
-
Method Details
-
hashCode
Calculate the combined hash code of two objects.- Parameters:
a
- the first objectb
- the second object- Returns:
- the combined hash code
-
getA
Get the first value.- Returns:
- the first value
-
getB
Get the second value.- Returns:
- the second value
-
readObject
Reinitialize the object and set the hash code.- Parameters:
ois
- the object input stream- Throws:
IOException
- if an I/O error occurs while reading the default fieldsClassNotFoundException
- if a class isn't found while reading the default fields
-
hashCode
public int hashCode()Return the combined hash code of the two argument objects. -
equals
Determine if this pair equals another. A pair is equal to another pair if both members are equal. -
equals
Determine if this pair equals another. A pair is equal to another pair if both members are equal.- Parameters:
other
- the other pair- Returns:
true
if they are equal,false
otherwise
-
toString
Get a string representation of this pair. -
create
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
-