org.apache.ignite.lang

## Class IgniteBiTuple<V1,V2>

- java.lang.Object
- - org.apache.ignite.lang.IgniteBiTuple<V1,V2>

All Implemented Interfaces:
  Externalizable, Serializable, Cloneable, Iterable<Object>, Map<V1,V2>, Map.Entry<V1,V2>

Direct Known Subclasses:
  IgnitePair, T2

    public class IgniteBiTuple<V1,V2>
    extends Object
    implements Map<V1,V2>, Map.Entry<V1,V2>, Iterable<Object>, Externalizable, Cloneable

Convenience class representing mutable tuple of two values.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from interface java.util.Map

`Map.Entry<K,V>`

### Constructor Summary

Constructors
Constructor and Description
`IgniteBiTuple()` Empty constructor required by `Externalizable`.
`IgniteBiTuple(V1 val1, V2 val2)` Fully initializes this tuple.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `clear()`
`Object` `clone()`
`boolean` `containsKey(Object key)`
`boolean` `containsValue(Object val)`
`Set<Map.Entry<V1,V2>>` `entrySet()`
`boolean` `equals(Object o)`
`V2` `get(Object key)`
`V1` `get1()` Gets first value.
`V2` `get2()` Gets second value.
`V1` `getKey()`
`V2` `getValue()`
`int` `hashCode()`
`boolean` `isEmpty()`
`Iterator<Object>` `iterator()`
`Set<V1>` `keySet()`
`V2` `put(V1 key, V2 val)`
`void` `putAll(Map<? extends V1,? extends V2> m)`
`void` `readExternal(ObjectInput in)`
`V2` `remove(Object key)`
`void` `set(V1 val1, V2 val2)` Sets both values in the tuple.
`void` `set1(V1 val1)` Sets first value.
`void` `set2(V2 val2)` Sets second value.
`V2` `setValue(V2 val)`
`int` `size()`
`IgniteBiTuple<V2,V1>` `swap()` Swaps values.
`String` `toString()`
`Collection<V2>` `values()`
`void` `writeExternal(ObjectOutput out)`

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

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

### Methods inherited from interface java.util.Map

`compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll`

### Methods inherited from interface java.util.Map.Entry

`comparingByKey, comparingByKey, comparingByValue, comparingByValue`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

### Constructor Detail

#### IgniteBiTuple

    public IgniteBiTuple()

Empty constructor required by `Externalizable`.

#### IgniteBiTuple

    public IgniteBiTuple(@Nullable
                         V1 val1,
                         @Nullable
                         V2 val2)

Fully initializes this tuple.

Parameters:
  `val1` - First value.
  `val2` - Second value.

### Method Detail

#### swap

    public IgniteBiTuple<V2,V1> swap()

Swaps values.

Returns:
  New tuple with swapped values.

#### get1

    public V1 get1()

Gets first value.

Returns:
  First value.

#### get2

    public V2 get2()

Gets second value.

Returns:
  Second value.

#### set1

    public void set1(@Nullable
                     V1 val1)

Sets first value.

Parameters:
  `val1` - First value.

#### set2

    public void set2(@Nullable
                     V2 val2)

Sets second value.

Parameters:
  `val2` - Second value.

#### set

    public void set(@Nullable
                    V1 val1,
                    @Nullable
                    V2 val2)

Sets both values in the tuple.

Parameters:
  `val1` - First value.
  `val2` - Second value.

#### getKey

    @Nullable
    public V1 getKey()

Specified by:
  `getKey` in interface `Map.Entry<V1,V2>`

#### getValue

    @Nullable
    public V2 getValue()

Specified by:
  `getValue` in interface `Map.Entry<V1,V2>`

#### setValue

    public V2 setValue(@Nullable
                       V2 val)

Specified by:
  `setValue` in interface `Map.Entry<V1,V2>`

#### iterator

    public Iterator<Object> iterator()

Specified by:
  `iterator` in interface `Iterable<Object>`

#### size

    public int size()

Specified by:
  `size` in interface `Map<V1,V2>`

#### isEmpty

    public boolean isEmpty()

Specified by:
  `isEmpty` in interface `Map<V1,V2>`

#### containsKey

    public boolean containsKey(Object key)

Specified by:
  `containsKey` in interface `Map<V1,V2>`

#### containsValue

    public boolean containsValue(Object val)

Specified by:
  `containsValue` in interface `Map<V1,V2>`

#### get

    @Nullable
    public V2 get(Object key)

Specified by:
  `get` in interface `Map<V1,V2>`

#### put

    @Nullable
    public V2 put(V1 key,
                            V2 val)

Specified by:
  `put` in interface `Map<V1,V2>`

#### remove

    @Nullable
    public V2 remove(Object key)

Specified by:
  `remove` in interface `Map<V1,V2>`

#### putAll

    public void putAll(Map<? extends V1,? extends V2> m)

Specified by:
  `putAll` in interface `Map<V1,V2>`

#### clear

    public void clear()

Specified by:
  `clear` in interface `Map<V1,V2>`

#### keySet

    public Set<V1> keySet()

Specified by:
  `keySet` in interface `Map<V1,V2>`

#### values

    public Collection<V2> values()

Specified by:
  `values` in interface `Map<V1,V2>`

#### entrySet

    public Set<Map.Entry<V1,V2>> entrySet()

Specified by:
  `entrySet` in interface `Map<V1,V2>`

#### clone

    public Object clone()

Overrides:
  `clone` in class `Object`

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### hashCode

    public int hashCode()

Specified by:
  `hashCode` in interface `Map<V1,V2>`
Specified by:
  `hashCode` in interface `Map.Entry<V1,V2>`
Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object o)

Specified by:
  `equals` in interface `Map<V1,V2>`
Specified by:
  `equals` in interface `Map.Entry<V1,V2>`
Overrides:
  `equals` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.11.1
Release Date | : December 20 2021