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 classCreate a builder for processing Deephaven table data into string outputstatic classprotected static interfacestatic interfaceprotected classprotected 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 voidmakeFieldProcessor(String fieldName, String columnName) Create a field processor that translates a given column from its Deephaven row number to JSON.protected TableToJSON.FieldProcessormakeTimestampProcessor(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 typeTwith 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> voidstoreCustomFunctionFieldProcessor(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 typeTwith 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
-