Package com.redwood.agent.api.rtx
Class RTXRow
- java.lang.Object
-
- com.redwood.agent.api.rtx.RTXRow
-
public class RTXRow extends Object
A row of data with typed values defined by metadata (RTXMetadata). A row can also have an optional key, which is only a label and can be used as reference to other data structures. No uniqueness is provided and keys cannot be used to access rows directly.getFormattedString(int)
andgetFormattedString(String)
methods are deprecated, use {getCanonicalStringValue(int)
or similar for canonical values and format yourself.
-
-
Constructor Summary
Constructors Constructor Description RTXRow(RTXMetadata newMetadata)
Create a row with the specified metadata.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description List<RTXColumn>
addAllMatching(RTXRow other)
Add all matching columns from the other row to this row.RTXRow
copy(RTXMetadata newMetadata)
<T> T
get(RTXColumn<T> column)
Get the value of the specified column as an appropriate object.BigDecimal
getBigDecimal(int columnIndex)
Get the value of the specified column as a BigDecimal.BigDecimal
getBigDecimal(RTXColumn column)
Get the value of the specified column as a BigDecimal.BigDecimal
getBigDecimal(String columnName)
Get the value of the specified column as a BigDecimal.String
getCanonicalStringValue(int columnIndex)
Get the value as in canonical form (as it would be written to a file).String
getCanonicalStringValue(RTXColumn column)
Get the value as in canonical form (as it would be written to a file).String
getCanonicalStringValue(String columnName)
Get the value as in canonical form (as it would be written to a file).ZonedDateTime
getDate(int columnIndex)
Get the value of the specified column as a DateTimeZone.ZonedDateTime
getDate(RTXColumn column)
Get the value of the specified column as a DateTimeZone.ZonedDateTime
getDate(String columnName)
Get the value of the specified column as a DateTimeZone.String
getFormattedString(int columnIndex)
Deprecated.String
getFormattedString(String columnName)
Deprecated.String
getKey()
Get the key.RTXMetadata
getMetadata()
Get the metadata.Object
getObject(int columnIndex)
Get the value of the specified column as an appropriate object.Object
getObject(RTXColumn column)
Get the value of the specified column as an appropriate object.Object
getObject(String columnName)
Get the value of the specified column as an appropriate object.String
getString(int columnIndex)
Get the value of the specified column as a String.String
getString(RTXColumn column)
Get the value of the specified column as a String.String
getString(String columnName)
Get the value of the specified column as a String.void
set(int columnIndex, Object columnValue)
Set the column to the value.void
set(RTXColumn column, Object columnValue)
Set the column to the value.void
set(String columnName, Object columnValue)
Set the column to the value.void
setKey(String newKey)
Set the key.String
toString()
-
-
-
Constructor Detail
-
RTXRow
public RTXRow(RTXMetadata newMetadata)
Create a row with the specified metadata.- Parameters:
newMetadata
- the metadata.
-
-
Method Detail
-
copy
public RTXRow copy(RTXMetadata newMetadata) throws RTXIncompatibleColumnException, RTXColumnRuntimeException
-
set
public void set(int columnIndex, Object columnValue) throws RTXColumnRuntimeException
Set the column to the value.- Parameters:
columnIndex
- the column index (0 based)columnValue
- the column value- Throws:
RTXColumnRuntimeException
- if an error occurs.
-
set
public void set(String columnName, Object columnValue) throws RTXColumnRuntimeException
Set the column to the value.- Parameters:
columnName
- the column name (case insensitive)columnValue
- the column value- Throws:
RTXColumnRuntimeException
- if an error occurs.
-
set
public void set(RTXColumn column, Object columnValue) throws RTXColumnRuntimeException
Set the column to the value. If the column is from this table, the index will be used (faster), otherwise the column will be looked up by name (slower). If the name can't be found or the columns are of different types, an exception will be thrown.- Parameters:
column
- the columncolumnValue
- the column value- Throws:
RTXColumnRuntimeException
- if an error occurs.
-
getKey
public String getKey()
Get the key.- Returns:
- the optional key of this row, which is only a label and can be used as reference to other data structures. No uniqueness is provided and keys cannot be used to access rows directly.
-
setKey
public void setKey(String newKey)
Set the key. Sets the optional key of this row, which is only a label and can be used as reference to other data structures. No uniqueness is provided and keys cannot be used to access rows directly.- Parameters:
newKey
-
-
getBigDecimal
public BigDecimal getBigDecimal(int columnIndex) throws RTXColumnRuntimeException
Get the value of the specified column as a BigDecimal.- Parameters:
columnIndex
- the column index (0 based)- Returns:
- the value as a BigDecimal.
- Throws:
RTXColumnRuntimeException
- if an error occurs.
-
getBigDecimal
public BigDecimal getBigDecimal(String columnName) throws RTXColumnRuntimeException
Get the value of the specified column as a BigDecimal.- Parameters:
columnName
- the column name (case insensitive)- Returns:
- the value as a BigDecimal.
- Throws:
RTXColumnRuntimeException
- if an error occurs.
-
getBigDecimal
public BigDecimal getBigDecimal(RTXColumn column)
Get the value of the specified column as a BigDecimal.- Parameters:
column
- the column- Returns:
- the value as a BigDecimal.
- Throws:
RTXColumnRuntimeException
- if an error occurs.
-
getString
public String getString(int columnIndex) throws RTXColumnRuntimeException
Get the value of the specified column as a String.- Parameters:
columnIndex
- the column index (0 based)- Returns:
- the value as a String.
- Throws:
RTXColumnRuntimeException
- if an error occurs.
-
getString
public String getString(String columnName) throws RTXColumnRuntimeException
Get the value of the specified column as a String.- Parameters:
columnName
- the column name (case insensitive)- Returns:
- the value as a String.
- Throws:
RTXColumnRuntimeException
- if an error occurs.
-
getString
public String getString(RTXColumn column)
Get the value of the specified column as a String.- Parameters:
column
- the column- Returns:
- the value as a String.
- Throws:
RTXColumnRuntimeException
- if an error occurs.
-
getDate
public ZonedDateTime getDate(int columnIndex)
Get the value of the specified column as a DateTimeZone.- Parameters:
columnIndex
- the column index (0 based)- Returns:
- the value as a DateTimeZone.
- Throws:
RTXColumnRuntimeException
- if an error occurs.
-
getDate
public ZonedDateTime getDate(String columnName)
Get the value of the specified column as a DateTimeZone.- Parameters:
columnName
- the column name (case insensitive)- Returns:
- the value as a DateTimeZone.
- Throws:
RTXColumnRuntimeException
- if an error occurs.
-
getDate
public ZonedDateTime getDate(RTXColumn column)
Get the value of the specified column as a DateTimeZone.- Parameters:
column
- the column- Returns:
- the value as a DateTimeZone.
- Throws:
RTXColumnRuntimeException
- if an error occurs.
-
get
public <T> T get(RTXColumn<T> column)
Get the value of the specified column as an appropriate object.- Parameters:
column
- the column- Returns:
- the value as a DateTimeZone.
- Throws:
RTXColumnRuntimeException
- if an error occurs.
-
getObject
public Object getObject(int columnIndex) throws RTXColumnRuntimeException
Get the value of the specified column as an appropriate object.- Parameters:
columnIndex
- the column index (0 based)- Returns:
- the value as a DateTimeZone.
- Throws:
RTXColumnRuntimeException
- if an error occurs.
-
getObject
public Object getObject(String columnName) throws RTXColumnRuntimeException
Get the value of the specified column as an appropriate object.- Parameters:
columnName
- the column name (case insensitive)- Returns:
- the value as a DateTimeZone.
- Throws:
RTXColumnRuntimeException
- if an error occurs.
-
getObject
public Object getObject(RTXColumn column)
Get the value of the specified column as an appropriate object.- Parameters:
column
- the column- Returns:
- the value as a DateTimeZone.
- Throws:
RTXColumnRuntimeException
- if an error occurs.
-
getFormattedString
@Deprecated public String getFormattedString(int columnIndex) throws RTXColumnRuntimeException
Deprecated.- Throws:
RTXColumnRuntimeException
-
getFormattedString
@Deprecated public String getFormattedString(String columnName) throws RTXColumnRuntimeException
Deprecated.- Throws:
RTXColumnRuntimeException
-
getCanonicalStringValue
public String getCanonicalStringValue(int columnIndex) throws RTXColumnRuntimeException
Get the value as in canonical form (as it would be written to a file).- Parameters:
columnIndex
- column index (0 based)- Returns:
- canonical string form.
- Throws:
RTXColumnRuntimeException
- for an invalid column
-
getCanonicalStringValue
public String getCanonicalStringValue(String columnName) throws RTXColumnRuntimeException
Get the value as in canonical form (as it would be written to a file).- Parameters:
columnName
- column name- Returns:
- canonical string form.
- Throws:
RTXColumnRuntimeException
- for an invalid column
-
getCanonicalStringValue
public String getCanonicalStringValue(RTXColumn column) throws RTXColumnRuntimeException
Get the value as in canonical form (as it would be written to a file).- Parameters:
column
- column- Returns:
- canonical string form.
- Throws:
RTXColumnRuntimeException
- for an invalid column
-
getMetadata
public RTXMetadata getMetadata()
Get the metadata.- Returns:
- the metadata for this row.
-
addAllMatching
public List<RTXColumn> addAllMatching(RTXRow other)
Add all matching columns from the other row to this row.- Parameters:
other
- the other row.- Returns:
- a list of matching columns.
-
-