@Experimental public abstract class Row extends java.lang.Object implements java.io.Serializable
Row
is an immutable tuple-like type to represent one element in a
PCollection
. The fields are described with a RowType
.
RowType
contains the names for each field and the coder for the whole
record, {see @link RowType#getRowCoder()}.
Modifier and Type | Class and Description |
---|---|
static class |
Row.Builder
Builder for
Row . |
Constructor and Description |
---|
Row() |
Modifier and Type | Method and Description |
---|---|
java.math.BigDecimal |
getBigDecimal(int idx)
Get a
BigDecimal value by field index, ClassCastException is thrown
if type doesn't match. |
java.math.BigDecimal |
getBigDecimal(java.lang.String fieldName)
Get a
BigDecimal value by field name, ClassCastException is thrown
if type doesn't match. |
java.lang.Boolean |
getBoolean(int idx)
Get a
Boolean value by field index, ClassCastException is thrown
if type doesn't match. |
java.lang.Boolean |
getBoolean(java.lang.String fieldName)
Get a
Boolean value by field name, ClassCastException is thrown
if type doesn't match. |
java.lang.Byte |
getByte(int idx)
Get a
Byte value by field index, ClassCastException is thrown
if type doesn't match. |
java.lang.Byte |
getByte(java.lang.String fieldName)
Get a
Byte value by field name, ClassCastException is thrown
if type doesn't match. |
java.util.Date |
getDate(int idx)
Get a
Date value by field index, ClassCastException is thrown
if type doesn't match. |
java.util.Date |
getDate(java.lang.String fieldName)
Get a
Date value by field name, ClassCastException is thrown
if type doesn't match. |
java.lang.Double |
getDouble(int idx)
Get a
Double value by field index, ClassCastException is thrown
if type doesn't match. |
java.lang.Double |
getDouble(java.lang.String fieldName)
Get a
Double value by field name, ClassCastException is thrown
if type doesn't match. |
int |
getFieldCount()
Return the size of data fields.
|
java.lang.Float |
getFloat(int idx)
Get a
Float value by field index, ClassCastException is thrown
if type doesn't match. |
java.lang.Float |
getFloat(java.lang.String fieldName)
Get a
Float value by field name, ClassCastException is thrown
if type doesn't match. |
java.util.GregorianCalendar |
getGregorianCalendar(int idx)
Get a
GregorianCalendar value by field index, ClassCastException is thrown
if type doesn't match. |
java.util.GregorianCalendar |
getGregorianCalendar(java.lang.String fieldName)
Get a
GregorianCalendar value by field name, ClassCastException is thrown
if type doesn't match. |
java.lang.Integer |
getInteger(int idx)
Get a
Integer value by field index, ClassCastException is thrown
if type doesn't match. |
java.lang.Integer |
getInteger(java.lang.String fieldName)
Get a
Integer value by field name, ClassCastException is thrown
if type doesn't match. |
java.lang.Long |
getLong(int idx)
Get a
Long value by field index, ClassCastException is thrown
if type doesn't match. |
java.lang.Long |
getLong(java.lang.String fieldName)
Get a
Long value by field name, ClassCastException is thrown
if type doesn't match. |
abstract RowType |
getRowType()
Return
RowType which describes the fields. |
java.lang.Short |
getShort(int idx)
Get a
Short value by field index, ClassCastException is thrown
if type doesn't match. |
java.lang.Short |
getShort(java.lang.String fieldName)
Get a
Short value by field name, ClassCastException is thrown
if type doesn't match. |
java.lang.String |
getString(int idx)
Get a
String value by field index, ClassCastException is thrown
if type doesn't match. |
java.lang.String |
getString(java.lang.String fieldName)
Get a
String value by field name, ClassCastException is thrown
if type doesn't match. |
<T> T |
getValue(int fieldIdx)
Get value by field index,
ClassCastException is thrown
if type doesn't match. |
<T> T |
getValue(java.lang.String fieldName)
Get value by field name,
ClassCastException is thrown
if type doesn't match. |
abstract java.util.List<java.lang.Object> |
getValues()
Return the list of data values.
|
static Row |
nullRow(RowType rowType)
Creates a new record filled with nulls.
|
static <T> java.util.stream.Collector<T,java.util.List<java.lang.Object>,Row> |
toRow(RowType rowType)
Creates a
Row from the list of values and getRowType() . |
static Row.Builder |
withRowType(RowType rowType)
Creates a record builder with specified
getRowType() . |
public static <T> java.util.stream.Collector<T,java.util.List<java.lang.Object>,Row> toRow(RowType rowType)
Row
from the list of values and getRowType()
.public <T> T getValue(java.lang.String fieldName)
ClassCastException
is thrown
if type doesn't match.@Nullable public <T> T getValue(int fieldIdx)
ClassCastException
is thrown
if type doesn't match.public java.lang.Byte getByte(java.lang.String fieldName)
Byte
value by field name, ClassCastException
is thrown
if type doesn't match.public java.lang.Short getShort(java.lang.String fieldName)
Short
value by field name, ClassCastException
is thrown
if type doesn't match.public java.lang.Integer getInteger(java.lang.String fieldName)
Integer
value by field name, ClassCastException
is thrown
if type doesn't match.public java.lang.Float getFloat(java.lang.String fieldName)
Float
value by field name, ClassCastException
is thrown
if type doesn't match.public java.lang.Double getDouble(java.lang.String fieldName)
Double
value by field name, ClassCastException
is thrown
if type doesn't match.public java.lang.Long getLong(java.lang.String fieldName)
Long
value by field name, ClassCastException
is thrown
if type doesn't match.public java.lang.String getString(java.lang.String fieldName)
String
value by field name, ClassCastException
is thrown
if type doesn't match.public java.util.Date getDate(java.lang.String fieldName)
Date
value by field name, ClassCastException
is thrown
if type doesn't match.public java.util.GregorianCalendar getGregorianCalendar(java.lang.String fieldName)
GregorianCalendar
value by field name, ClassCastException
is thrown
if type doesn't match.public java.math.BigDecimal getBigDecimal(java.lang.String fieldName)
BigDecimal
value by field name, ClassCastException
is thrown
if type doesn't match.public java.lang.Boolean getBoolean(java.lang.String fieldName)
Boolean
value by field name, ClassCastException
is thrown
if type doesn't match.public java.lang.Byte getByte(int idx)
Byte
value by field index, ClassCastException
is thrown
if type doesn't match.public java.lang.Short getShort(int idx)
Short
value by field index, ClassCastException
is thrown
if type doesn't match.public java.lang.Integer getInteger(int idx)
Integer
value by field index, ClassCastException
is thrown
if type doesn't match.public java.lang.Float getFloat(int idx)
Float
value by field index, ClassCastException
is thrown
if type doesn't match.public java.lang.Double getDouble(int idx)
Double
value by field index, ClassCastException
is thrown
if type doesn't match.public java.lang.Long getLong(int idx)
Long
value by field index, ClassCastException
is thrown
if type doesn't match.public java.lang.String getString(int idx)
String
value by field index, ClassCastException
is thrown
if type doesn't match.public java.util.Date getDate(int idx)
Date
value by field index, ClassCastException
is thrown
if type doesn't match.public java.util.GregorianCalendar getGregorianCalendar(int idx)
GregorianCalendar
value by field index, ClassCastException
is thrown
if type doesn't match.public java.math.BigDecimal getBigDecimal(int idx)
BigDecimal
value by field index, ClassCastException
is thrown
if type doesn't match.public java.lang.Boolean getBoolean(int idx)
Boolean
value by field index, ClassCastException
is thrown
if type doesn't match.public int getFieldCount()
public abstract java.util.List<java.lang.Object> getValues()
public static Row.Builder withRowType(RowType rowType)
getRowType()
.
Row.Builder.build()
will throw an IllegalArgumentException
if number of fields
in getRowType()
does not match the number of fields specified.