Package com.illumon.iris.db.tables.utils
Class TableToJSON.Builder
java.lang.Object
com.illumon.iris.db.tables.utils.TableToJSON.Builder
- Enclosing class:
- TableToJSON
Create a builder for processing Deephaven table data into string output
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCustomFunction
(String field, TableToJSON.CustomFunction<?> func) Apply a generic function transforming data from Deephaven into a generic publishable format.autoValueMapping
(boolean autoValueMapping) Enables or disables automatic value mapping (true by default).Create a factory according to the specifications of this builder.excludeColumn
(String column) Indicates that a column is unmapped, and therefore not included in the output.ignoreMissingColumns
(boolean ignoreMissingColumns) Permit the builder to silently ignore any columns not specified.Map a Deephaven column to an output field of the same name.Map a Deephaven column to a specified output field.nestedObjectDelimiter
(String nestedObjectDelimiter) The delimiter used to generate nested output objects from column names.outputNulls
(boolean outputNulls) Whether to output null values.timestampFieldName
(String timestampFieldName) Include a timestamp indicating when this data was processed.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
autoValueMapping
Enables or disables automatic value mapping (true by default). If auto value mapping is enabled, any column that was not defined [either by excludeColumn or mapColumn] is automatically mapped to a JSON field of the same name.- Parameters:
autoValueMapping
- should automatic value mapping be enabled- Returns:
- this builder
-
ignoreMissingColumns
Permit the builder to silently ignore any columns not specified. False by default. If auto value mapping is enabled, this has no effect.- Parameters:
ignoreMissingColumns
- True if the builder should ignore table columns with no specified behavior. false if the builder should throw an exception if columns are found with no mapping.- Returns:
- this builder
-
excludeColumn
Indicates that a column is unmapped, and therefore not included in the output. You may not exclude a column that has already been excluded or mapped.- Parameters:
column
- name of the column in the output table- Returns:
- this builder
-
mapColumn
Map a Deephaven column to an output field of the same name. You may map the same column to multiple output fields, but may only map a given field once.- Parameters:
column
- The name of the Deephaven column to export- Returns:
- this builder
-
mapColumn
Map a Deephaven column to a specified output field. You may map multiple output fields from a single column., but may only map a given field once.- Parameters:
column
- The name of the Deephaven column to exportfield
- The name of the field to produce- Returns:
- this builder
-
addCustomFunction
public TableToJSON.Builder addCustomFunction(@NotNull String field, @NotNull TableToJSON.CustomFunction<?> func) Apply a generic function transforming data from Deephaven into a generic publishable format. The output object will then be processed by an implementing class into its final form.- Parameters:
field
- The name of the field to be produced by the functionfunc
- A CustomFunction object containing the desired output type and the function that will produce the desired publishable output, given an index row number and whether or not this is a 'remove' operation or not (as removals must use 'getPrev' instead of 'get' to retrieve their data from a source).- Returns:
- this builder
-
timestampFieldName
Include a timestamp indicating when this data was processed.- Parameters:
timestampFieldName
- The name of the field to show a timestamp, or null for no timestamp.- Returns:
- this builder
-
nestedObjectDelimiter
The delimiter used to generate nested output objects from column names.- Parameters:
nestedObjectDelimiter
- the delimiter string/character.- Returns:
- this builder
-
outputNulls
Whether to output null values.- Parameters:
outputNulls
- to output nulls- Returns:
- this builder
-
buildFactory
Create a factory according to the specifications of this builder.- Returns:
- a factory for creating a StringTableWriterAdapter from a TableWriter
-