# Pair

`com.jsmacrosce.Pair`

Stores two mutable values in positional order: `T` is first and `U` is second.  
 ```js
const Pair = Java.type("com.jsmacrosce.Pair");  
const pair = new Pair("first", 2);  
pair.getT(); // "first"
pair.getU(); // 2
 ```

## Type Parameters

- `T`: the type of the first value
- `U`: the type of the second value

## Constructors

### new Pair {#com.jsmacrosce.Pair_constructor-T-U-}

```js
new Pair(T t, U u)
```

Stores the supplied first and second values, respectively.

**Parameters:**
- `t`: the first value
- `u`: the second value

## Methods

### getT {#com.jsmacrosce.Pair_getT-}

```js
getT(): T
```

Returns the first stored value, which may be `null` if `null` was stored.

**Returns:** the first stored value

### getU {#com.jsmacrosce.Pair_getU-}

```js
getU(): U
```

Returns the second stored value, which may be `null` if `null` was stored.

**Returns:** the second stored value

### setT {#com.jsmacrosce.Pair_setT-T-}

```js
setT(T t): void
```

Replaces the first stored value.

**Parameters:**
- `t`: the new first value

### setU {#com.jsmacrosce.Pair_setU-U-}

```js
setU(U u): void
```

Replaces the second stored value.

**Parameters:**
- `u`: the new second value
