public abstract class Tuple extends Object implements Serializable
Tuple1 to Tuple25.
The fields in the tuples may be accessed directly a public fields, or via position (zero indexed)
getField(int).
Tuples are in principle serializable. However, they may contain non-serializable fields, in which case serialization will fail.
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_ARITY |
| Constructor and Description |
|---|
Tuple() |
| Modifier and Type | Method and Description |
|---|---|
abstract int |
getArity()
Gets the number of field in the tuple (the tuple arity).
|
abstract <T> T |
getField(int pos)
Gets the field at the specified position.
|
<T> T |
getFieldNotNull(int pos)
Gets the field at the specified position, throws NullFieldException if the field is null.
|
abstract <T> void |
setField(T value,
int pos)
Sets the field at the specified position.
|
public static final int MAX_ARITY
public abstract <T> T getField(int pos)
pos - The position of the field, zero indexed.IndexOutOfBoundsException - Thrown, if the position is negative, or equal to, or larger than the number of fields.public <T> T getFieldNotNull(int pos)
pos - The position of the field, zero indexed.IndexOutOfBoundsException - Thrown, if the position is negative, or equal to, or larger than the number of fields.NullFieldException - Thrown, if the field at pos is null.public abstract <T> void setField(T value,
int pos)
value - The value to be assigned to the field at the specified position.pos - The position of the field, zero indexed.IndexOutOfBoundsException - Thrown, if the position is negative, or equal to, or larger than the number of fields.public abstract int getArity()
Copyright © 2015 The Apache Software Foundation. All rights reserved.