@PublicEvolving public final class Row extends Object implements Serializable
| Constructor and Description |
|---|
Row() |
Row(List<String> columns)
Initializes a row with list of columns.
|
Row(Row row)
Makes a copy of the row.
|
Row(String name,
Object value)
Initializes the row with column name and value.
|
| Modifier and Type | Method and Description |
|---|---|
Row |
add(String name,
Object value)
Adds a value into row with name.
|
void |
addOrSet(String name,
Object value)
Adds or sets the value.
|
void |
addOrSetAtIndex(int index,
String name,
Object value)
Adds or sets the value to the beginning.
|
boolean |
equals(Object o) |
int |
find(String col)
Finds a column index based on the name of the column.
|
int |
find(String col,
int firstIdx)
Finds a column index based on the name of the column.
|
String |
getColumn(int idx)
Gets a column name by index.
|
List<Pair<String,Object>> |
getFields() |
Object |
getValue(int idx)
Gets a value of row at specified index.
|
Object |
getValue(String col)
Gets value based on the column name.
|
int |
hashCode() |
int |
length()
Deprecated.
|
Row |
remove(int idx)
Removes the column and value at given index.
|
void |
setColumn(int idx,
String name)
Sets the name of the column at a given index.
|
Row |
setValue(int idx,
Object value)
Updates the value of the row at index idx.
|
int |
width() |
public Row()
public Row(Row row)
row - to be copied to 'this' object.public Row(List<String> columns)
columns - to set in the row.public String getColumn(int idx)
idx - to retrieve the name of the column.public void setColumn(int idx,
String name)
idx - at which the new name to be set.name - of the column to be set at idx.public Object getValue(int idx)
idx - from where the value should be retrieved.public Object getValue(String col)
col - name of the column for which the value is retrieved.public Row setValue(int idx, Object value)
idx - index at which the value needs to be updated.value - value to be updated at index (idx).public Row add(String name, Object value)
name - of the value to be added to row.value - to be added to row.public Row remove(int idx)
idx - for which the value and column are removed.public int find(String col)
col - to be searched within the row.public int find(String col, int firstIdx)
col - to be searched within the row.firstIdx - first index to check@Deprecated public int length()
public int width()
public void addOrSet(String name, Object value)
name - of the field to be either set or added to record.value - to be added.public void addOrSetAtIndex(int index,
String name,
Object value)
index - at which the column need to be inserted.name - of the field to be either set or added to record.value - to be added.Copyright © 2023 CDAP Licensed under the Apache License, Version 2.0.