Package guru.mikelue.foxglove
Interface TupleAccessor
public interface TupleAccessor
Easy to be used for auto-casting on values of a tuple.
-
Method Summary
Modifier and TypeMethodDescriptionasMap()Gets all columns as a map.Gets metadata of all columns of the generated row.<T> TGets the value of a column with auto-casting.booleanChecks whether or not the generated row has the given column.intindex()Gets the index(starts with0) for theTableFacet.<T> voidSets the value of a column.
-
Method Details
-
getValue
Gets the value of a column with auto-casting.- Type Parameters:
T- Expected type of the column- Parameters:
name- Name of the column- Returns:
- Value of the column
- Throws:
ClassCastException- When the value cannot be casted to the expected typeIllegalArgumentException- When the column name is not existing- See Also:
-
setValue
Sets the value of a column.- Type Parameters:
T- Type of the value- Parameters:
name- Name of the columnvalue- Value to be set- Throws:
IllegalArgumentException- When the column name is not existing- See Also:
-
hasColumn
Checks whether or not the generated row has the given column.- Parameters:
name- Name of the column- Returns:
- true if the generated row has the given column; false otherwise
-
getMetaOfColumns
List<ColumnMeta> getMetaOfColumns()Gets metadata of all columns of the generated row.- Returns:
- List of ColumnMeta of all columns
-
asMap
Map<ColumnMeta,Object> asMap()Gets all columns as a map.- Returns:
- read-only Map with duplicated column names and their values
-
index
int index()Gets the index(starts with0) for theTableFacet.- Returns:
- Index for of generated rows on the TableFacet
-