public class DataTable extends Object
Modifier and Type | Method and Description |
---|---|
static DataTable |
createBasicInstance(List<String> columns)
Creates a new instance with the given column setup.
|
static DataTable |
createBasicInstance(String firstColumn,
String... otherColumns)
Creates a new instance with the given column setup.
|
static DataTable |
createDetailedInstance(DataColumn firstColumn,
DataColumn... otherColumns)
Creates a new instance with the given column setup.
|
static DataTable |
createDetailedInstance(List<DataColumn> columns)
Creates a new instance with the given column setup.
|
DataRow |
createRow()
Creates a new, empty row in the table.
|
DataTable |
createRow(String... values)
Creates a new row in the table containing the given values.
|
List<DataColumn> |
getColumns()
Returns all columns in this table.
|
OverwritePolicy |
getOverwritePolicy()
Returns the current overwrite policy of this table.
|
List<DataRow> |
getRows()
Returns all rows currently in this table.
|
DataTable |
setOverwritePolicy(OverwritePolicy overwritePolicy)
Sets the overwrite policy to use with this table.
|
com.fasterxml.jackson.databind.JsonNode |
toJson()
Returns this table in JSON representation.
|
public static DataTable createBasicInstance(String firstColumn, String... otherColumns)
firstColumn
- first columnotherColumns
- additional, optional columnspublic static DataTable createBasicInstance(List<String> columns) throws NoColumnsException
columns
- columns for the tableNoColumnsException
- if the list is emptypublic static DataTable createDetailedInstance(DataColumn firstColumn, DataColumn... otherColumns)
firstColumn
- first columnotherColumns
- additional, optional columnspublic static DataTable createDetailedInstance(List<DataColumn> columns) throws NoColumnsException
columns
- columns for the tableNoColumnsException
- if the list is emptypublic DataTable createRow(String... values) throws TooManyColumnsException
values
- the column values to setTooManyColumnsException
- if more values are given than columns are
availablepublic DataRow createRow()
public List<DataRow> getRows()
public List<DataColumn> getColumns()
public DataTable setOverwritePolicy(OverwritePolicy overwritePolicy) throws UnknownColumnException
OverwritePolicy.deleteNone()
is used.overwritePolicy
- the overwrite policy to useUnknownColumnException
- if any of the columns used in the policy
doesn't exist in the tablepublic OverwritePolicy getOverwritePolicy()
public com.fasterxml.jackson.databind.JsonNode toJson()
Copyright © 2014. All rights reserved.