JBoss Marshalling 1.2.1.GA

org.jboss.marshalling
Class Pair<A,B>

java.lang.Object
  extended by org.jboss.marshalling.Pair<A,B>
Type Parameters:
A - the first value type
B - the second value type
All Implemented Interfaces:
Serializable

@Externalize(value=Pair.Externalizer.class)
public final class Pair<A,B>
extends Object
implements Serializable

A serialiable pair of values. There is also a specified externalizer as well, to support more efficient I/O.

See Also:
Serialized Form

Nested Class Summary
static class Pair.Externalizer
          An externalizer for Pair instances.
 
Constructor Summary
Pair(A a, B b)
          Create a new instance.
 
Method Summary
static
<A,B> Pair<A,B>
create(A a, B b)
          Create a new instance.
 A getA()
          Get the first value.
 B getB()
          Get the second value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pair

public Pair(A a,
            B b)
Create a new instance.

Parameters:
a - the first value
b - the second value
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

create

public static <A,B> Pair<A,B> create(A a,
                                     B b)
Create a new instance.

Type Parameters:
A - the first value type
B - the second value type
Parameters:
a - the first value
b - the second value
Returns:
the new instance

JBoss Marshalling 1.2.1.GA

Copyright © 2010 JBoss, a division of Red Hat, Inc.