Package org.apache.solr.common.util

# Class Pair<T1,T2>

java.lang.Object
org.apache.solr.common.util.Pair<T1,T2>

All Implemented Interfaces:
  `Serializable`, `MapSerializable`, `MapWriter`, `NavigableObject`, `org.noggit.JSONWriter.Writable`

public class Pair<T1,T2> extends Object implements Serializable, MapWriter

See Also:
  - Serialized Form

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter

`MapWriter.EntryWriter`

## Field Summary

### Fields inherited from interface org.apache.solr.common.MapWriter

`EMPTY`

## Constructor Summary

Constructors
Constructor
Description
`Pair(T1 key, T2 value)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object that)`
`T1`
`first()`
`int`
`hashCode()`
`static Pair`
`parse(Map<String,?> m)`
`T2`
`second()`
`String`
`toString()`
`void`
`writeMap(MapWriter.EntryWriter ew)`
Writes this object's entries out to `ew`.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.apache.solr.common.MapWriter

`jsonStr, toMap, write`

### Methods inherited from interface org.apache.solr.common.NavigableObject

`_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size`

## Constructor Details

### Pair

public Pair(T1 key, T2 value)

## Method Details

### first

public T1 first()

### second

public T2 second()

### equals

public boolean equals(Object that)

Overrides:
  `equals` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### writeMap

public void writeMap(MapWriter.EntryWriter ew) throws IOException
Description copied from interface: `MapWriter`
Writes this object's entries out to `ew`.

Specified by:
  `writeMap` in interface `MapWriter`
Throws:
  `IOException`

### parse

public static Pair parse(Map<String,?> m)