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.RTXRowcopy(RTXMetadata newMetadata)<T> Tget(RTXColumn<T> column)Get the value of the specified column as an appropriate object.BigDecimalgetBigDecimal(int columnIndex)Get the value of the specified column as a BigDecimal.BigDecimalgetBigDecimal(RTXColumn column)Get the value of the specified column as a BigDecimal.BigDecimalgetBigDecimal(String columnName)Get the value of the specified column as a BigDecimal.StringgetCanonicalStringValue(int columnIndex)Get the value as in canonical form (as it would be written to a file).StringgetCanonicalStringValue(RTXColumn column)Get the value as in canonical form (as it would be written to a file).StringgetCanonicalStringValue(String columnName)Get the value as in canonical form (as it would be written to a file).ZonedDateTimegetDate(int columnIndex)Get the value of the specified column as a DateTimeZone.ZonedDateTimegetDate(RTXColumn column)Get the value of the specified column as a DateTimeZone.ZonedDateTimegetDate(String columnName)Get the value of the specified column as a DateTimeZone.StringgetFormattedString(int columnIndex)Deprecated.StringgetFormattedString(String columnName)Deprecated.StringgetKey()Get the key.RTXMetadatagetMetadata()Get the metadata.ObjectgetObject(int columnIndex)Get the value of the specified column as an appropriate object.ObjectgetObject(RTXColumn column)Get the value of the specified column as an appropriate object.ObjectgetObject(String columnName)Get the value of the specified column as an appropriate object.StringgetString(int columnIndex)Get the value of the specified column as a String.StringgetString(RTXColumn column)Get the value of the specified column as a String.StringgetString(String columnName)Get the value of the specified column as a String.voidset(int columnIndex, Object columnValue)Set the column to the value.voidset(RTXColumn column, Object columnValue)Set the column to the value.voidset(String columnName, Object columnValue)Set the column to the value.voidsetKey(String newKey)Set the key.StringtoString()
-
-
-
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 RTXColumnRuntimeExceptionSet 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.
-
-