Package com.illumon.iris.db.tables.utils
Class TableToJSON
java.lang.Object
com.illumon.iris.db.tables.utils.TableToJSON
this was copied from solace, combined abstract and concrete classes into one here.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Create a builder for processing Deephaven table data into string outputstatic class
protected static interface
static interface
protected class
protected static interface
-
Constructor Summary
ConstructorsConstructorDescriptionTableToJSON
(Table source, Map<String, String> columnsToOutputFields, Map<String, TableToJSON.CustomFunction<?>> customFunctions, Set<String> excludedColumns, boolean autoValueMapping, boolean ignoreMissingColumns, String timestampFieldName, String nestedObjectDelimiter, boolean outputNulls) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
makeFieldProcessor
(String fieldName, String columnName) Create a field processor that translates a given column from its Deephaven row number to JSON.protected TableToJSON.FieldProcessor
makeTimestampProcessor
(String fieldName) parseUpdate
(Index toProcess, boolean isRemoval) Convert the specified 'modified' rows from the update into JSON<T> List<T>
parseUpdate
(Index toProcess, boolean isRemoval, Function<io.deephaven.shadow.jackson.com.fasterxml.jackson.databind.node.ObjectNode, T> conversionFunction) Convert the specified 'modified' rows from the update into JSON ObjectNodes, then transform into typeT
with the givenconversionFunction
.List<io.deephaven.shadow.jackson.com.fasterxml.jackson.databind.node.ObjectNode>
parseUpdateToJsonNodes
(Index toProcess, boolean isRemoval) Convert the specified 'modified' rows from the update into JSON ObjectNodes.protected <T> void
storeCustomFunctionFieldProcessor
(String fieldName, TableToJSON.CustomFunction<T> customFunction)
-
Constructor Details
-
TableToJSON
-
-
Method Details
-
storeCustomFunctionFieldProcessor
protected <T> void storeCustomFunctionFieldProcessor(String fieldName, TableToJSON.CustomFunction<T> customFunction) -
makeFieldProcessor
Create a field processor that translates a given column from its Deephaven row number to JSON.- Parameters:
fieldName
- The name of the field in the output (if needed).columnName
- The Deephaven column to be translated into String format
-
makeTimestampProcessor
-
parseUpdate
Convert the specified 'modified' rows from the update into JSON- Parameters:
toProcess
- An Index indicating which rows were involved in this operationisRemoval
- Whether the Index is of removed rows- Returns:
- A List of Strings, each representing one modification
-
parseUpdateToJsonNodes
public List<io.deephaven.shadow.jackson.com.fasterxml.jackson.databind.node.ObjectNode> parseUpdateToJsonNodes(Index toProcess, boolean isRemoval) Convert the specified 'modified' rows from the update into JSON ObjectNodes.- Parameters:
toProcess
- An Index indicating which rows were involved in this operationisRemoval
- Whether the Index is of removed rows- Returns:
- A List of ObjectNodes, each representing one modification
-
parseUpdate
public <T> List<T> parseUpdate(Index toProcess, boolean isRemoval, Function<io.deephaven.shadow.jackson.com.fasterxml.jackson.databind.node.ObjectNode, T> conversionFunction) Convert the specified 'modified' rows from the update into JSON ObjectNodes, then transform into typeT
with the givenconversionFunction
.- Type Parameters:
T
- The data type into which the JSON ObjectNodes are converted.- Parameters:
toProcess
- An Index indicating which rows were involved in this operationisRemoval
- Whether the Index is of removed rowsconversionFunction
- A function to- Returns:
- A List of ObjectNodes, each representing one modification
-