net.shibboleth.utilities.java.support.collection
Class Pair<T1,T2>

java.lang.Object
  extended by net.shibboleth.utilities.java.support.collection.Pair<T1,T2>
Type Parameters:
T1 - type of the first object in the pair
T2 - type of the second object in the pair

public class Pair<T1,T2>
extends Object

Container for a pair of objects.


Field Summary
private  T1 first
          First object in pair.
private  T2 second
          Second object in pair.
 
Constructor Summary
Pair()
          Constructor.
Pair(Pair<? extends T1,? extends T2> pair)
          Copy constructor.
Pair(T1 newFirst, T2 newSecond)
          Constructor.
 
Method Summary
 boolean equals(Object o)
          
 T1 getFirst()
          Gets the first object in the pair.
 T2 getSecond()
          Gets the second object in the pair.
 int hashCode()
          
 void setFirst(T1 newFirst)
          Sets the first object in the pair.
 void setSecond(T2 newSecond)
          Sets the second object in the pair.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

first

private T1 first
First object in pair.


second

private T2 second
Second object in pair.

Constructor Detail

Pair

public Pair()
Constructor.


Pair

public Pair(@Nullable
            T1 newFirst,
            @Nullable
            T2 newSecond)
Constructor.

Parameters:
newFirst - first object in the pair
newSecond - second object in the pair

Pair

public Pair(@Nonnull
            Pair<? extends T1,? extends T2> pair)
Copy constructor.

Parameters:
pair - pair to be copied
Method Detail

getFirst

@Nullable
public T1 getFirst()
Gets the first object in the pair.

Returns:
first object in the pair

setFirst

public void setFirst(@Nullable
                     T1 newFirst)
Sets the first object in the pair.

Parameters:
newFirst - first object in the pair

getSecond

@Nullable
public T2 getSecond()
Gets the second object in the pair.

Returns:
second object in the pair

setSecond

public void setSecond(@Nullable
                      T2 newSecond)
Sets the second object in the pair.

Parameters:
newSecond - second object in the pair

equals

public boolean equals(@Nullable
                      Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

@Nonnull
public String toString()

Overrides:
toString in class Object


Copyright © 1999-2012. All Rights Reserved.