Package net.shibboleth.shared.collection

# Class Pair<T1,T2>

java.lang.Object
net.shibboleth.shared.collection.Pair<T1,T2>

Type Parameters:
  `T1` - type of the first object in the pair
  `T2` - type of the second object in the pair

Direct Known Subclasses:
  `LangBearingString`

public class Pair<T1,T2> extends Object
Container for a pair of objects.

## Field Summary

Fields
Modifier and Type
Field
Description
`private T1`
`first`
First object in pair.
`private T2`
`second`
Second object in pair.

## Constructor Summary

Constructors
Constructor
Description
`Pair()`
Constructor.
`Pair(Pair<? extends T1,? extends T2> pair)`
Copy constructor.
`Pair(T1 newFirst, T2 newSecond)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`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 Details

### first

@Nullable private T1 first
First object in pair.

### second

@Nullable private T2 second
Second object in pair.

## Constructor Details

### 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 Details

### 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

public String toString()

Overrides:
  `toString` in class `Object`