org.apache.ignite.internal.util.lang

## Class GridTuple<V>

- java.lang.Object
- - org.apache.ignite.internal.util.lang.GridTuple<V>

All Implemented Interfaces:
  Externalizable, Serializable, Cloneable, Iterable<V>

Direct Known Subclasses:
  T1

    public class GridTuple<V>
    extends Object
    implements Iterable<V>, Cloneable, Externalizable

Convenience class representing mutable tuple of a single value.

## Thread Safety

This class doesn't provide any synchronization for multi-threaded access and it is responsibility of the user of this class to provide outside synchronization, if needed.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`GridTuple()` Empty constructor required by `Externalizable`.
`GridTuple(V val)` Constructs mutable object with given value.

### Method Summary

Methods
`Object` `clone()`
`boolean` `equals(Object obj)`
`V` `get()` Gets value.
`int` `hashCode()`
`Iterator<V>` `iterator()`
`void` `readExternal(ObjectInput in)`
`void` `set(V val)` Sets value.
`String` `toString()`
`void` `writeExternal(ObjectOutput out)`

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

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

### Constructor Detail

#### GridTuple

    public GridTuple()

Empty constructor required by `Externalizable`.

#### GridTuple

    public GridTuple(@Nullable
             V val)

Constructs mutable object with given value.

Parameters:
  `val` - Wrapped value.

### Method Detail

#### get

    @Nullable
    public V get()

Gets value.

Returns:
  Wrapped value.

#### set

    public void set(@Nullable
           V val)

Sets value.

Parameters:
  `val` - Value to set.

#### iterator

    public Iterator<V> iterator()

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

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

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.7.0
Release Date | : August 1 2016