@PublicEvolving public class Row extends Object implements Serializable
RowTypeInfo
.
The fields in the Row can be accessed by position (zero-based) getField(int)
. And can
set fields by setField(int, Object)
.
Row is in principle serializable. However, it may contain non-serializable fields, in which case serialization will fail.
Constructor and Description |
---|
Row(int arity)
Create a new Row instance.
|
Modifier and Type | Method and Description |
---|---|
static Row |
copy(Row row)
Creates a new Row which copied from another row.
|
boolean |
equals(Object o) |
int |
getArity()
Get the number of fields in the Row.
|
Object |
getField(int pos)
Gets the field at the specified position.
|
int |
hashCode() |
static Row |
of(Object... values)
Creates a new Row and assigns the given values to the Row's fields.
|
static Row |
project(Row row,
int[] fields)
Creates a new Row with projected fields from another row.
|
void |
setField(int pos,
Object value)
Sets the field at the specified position.
|
String |
toString() |
public Row(int arity)
arity
- The number of fields in the Rowpublic int getArity()
public Object getField(int pos)
pos
- The position of the field, 0-based.IndexOutOfBoundsException
- Thrown, if the position is negative, or equal to, or larger than the number of fields.public void setField(int pos, Object value)
pos
- The position of the field, 0-based.value
- The value to be assigned to the field at the specified position.IndexOutOfBoundsException
- Thrown, if the position is negative, or equal to, or larger than the number of fields.public static Row of(Object... values)
For example:
Row.of("hello", true, 1L);}instead of
Row row = new Row(3); row.setField(0, "hello"); row.setField(1, true); row.setField(2, 1L);
public static Row copy(Row row)
row
- The row being copied.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.