Class TableResult
java.lang.Object
com.aoindustries.noc.monitor.common.Result
com.aoindustries.noc.monitor.common.TableResult
- All Implemented Interfaces:
Serializable
Encapsulates the results that may be in a table, including table columns headers and rows. Each row has a different alert level.
- Author:
- AO Industries, Inc.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTableResult
(long time, long latency, boolean isError, int columns, int rows, SerializableFunction<Locale, ? extends List<String>> columnHeaders, SerializableFunction<Locale, ? extends List<?>> tableData, List<AlertLevel> alertLevels) -
Method Summary
Modifier and TypeMethodDescriptionGets the alert level on a per-row basis.getColumnHeaders
(Locale locale) Gets the column headers for the table.int
Gets the number of columns in the table.int
getRows()
Gets the number of rows in the table.List
<?> getTableData
(Locale locale) Gets the table data.boolean
isError()
If is an error, columns=1, rows=1, and tableData.get(0) has the error.toString()
Methods inherited from class com.aoindustries.noc.monitor.common.Result
getLatency, getTime
-
Constructor Details
-
TableResult
public TableResult(long time, long latency, boolean isError, int columns, int rows, SerializableFunction<Locale, ? extends List<String>> columnHeaders, SerializableFunction<Locale, ? extends List<?>> tableData, List<AlertLevel> alertLevels) - Parameters:
alertLevels
- Must be unmodifiable - no defensive copy is made
-
-
Method Details
-
isError
public boolean isError()If is an error, columns=1, rows=1, and tableData.get(0) has the error. -
getColumns
public int getColumns()Gets the number of columns in the table. -
getRows
public int getRows()Gets the number of rows in the table. -
getColumnHeaders
Gets the column headers for the table. -
getTableData
Gets the table data. Each element may be found with the expression:List<?> tableData = tableResult.getTableData(); int columns = tableResult.getColumns(); Object cellData = tableData.get(row*columns + column);
-
getAlertLevels
Gets the alert level on a per-row basis. -
toString
-