Package io.deephaven.importers
Class BaseImportFieldWriter
java.lang.Object
io.deephaven.importers.ImportFieldWriter
io.deephaven.importers.BaseImportFieldWriter
- Direct Known Subclasses:
BaseCsvFieldWriter,CsvColumnDataTransformer
Holds the methods common to both CsvFieldWriter and CsvColumnDataTransformer.
-
Field Summary
Fields inherited from class io.deephaven.importers.ImportFieldWriter
constantColumnValue, log -
Constructor Summary
ConstructorsConstructorDescriptionBaseImportFieldWriter(Logger log, String dbColumnName, String arrayDelimiter) -
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimalgetBigDecimal(@NotNull String value, @Nullable String columnName, @NotNull Logger log, boolean strict, boolean failDefault, @Nullable BigDecimal onEmpty) Reads a BigDecimal value from a CSVRecordstatic BooleangetBoolean(@NotNull String value, @Nullable String columnName, @NotNull Logger log, boolean strict, boolean failDefault, Boolean onEmpty) Reads a Boolean value from a CSVRecord.static bytegetByte(@Nullable String value, @Nullable String columnName, @NotNull Logger log, boolean strict, boolean failDefault, byte onEmpty) Reads a byte value from a CSVRecordstatic chargetChar(@Nullable String value, @Nullable String columnName, @NotNull Logger log, boolean strict, boolean failDefault, char onEmpty) Reads a char value from a CSVRecordstatic doublegetDouble(@NotNull String value, @Nullable String columnName, @NotNull Logger log, boolean strict, boolean failDefault, double onEmpty) Reads a double value from a CSVRecordstatic floatgetFloat(@NotNull String value, @Nullable String columnName, @NotNull Logger log, boolean strict, boolean failDefault, float onEmpty) Reads a float value from a CSVRecordstatic intgetInt(@NotNull String value, @Nullable String columnName, @NotNull Logger log, boolean strict, boolean failDefault, int onEmpty) Reads an int value from a CSVRecordstatic longgetISONanos(@Nullable String value, @Nullable String columnName, @NotNull Logger log, boolean strict, boolean failDefault, long onEmpty) Reads a ISO formatted date value from a CSVRecord and converts it to nanoseconds since the epoch.static LocalDategetLocalDate(@NotNull String value, @Nullable String columnName, @NotNull Logger log, boolean strict, boolean failDefault, @Nullable LocalDate onEmpty) Read a LocalDate value from a CSVRecord.static LocalTimegetLocalTime(@NotNull String value, @Nullable String columnName, @NotNull Logger log, boolean strict, boolean failDefault, @Nullable LocalTime onEmpty) Read a LocalTime value from a CSVRecord.static longgetLong(@NotNull String value, @Nullable String columnName, @NotNull Logger log, boolean strict, boolean failDefault, long onEmpty) Reads a long value from a CSVRecordstatic shortgetShort(@NotNull String value, @Nullable String columnName, @NotNull Logger log, boolean strict, boolean failDefault, short onEmpty) Reads a short value from a CSVRecordstatic StringgetTrimmedStringNull(@Nullable String value, @Nullable String columnName) Reads a String value from a CSVRecord.Methods inherited from class io.deephaven.importers.ImportFieldWriter
accountingDouble, accountingInt, accountingLong, createFormula, createTransform, createTransformDeclaration, getBigDecimalArray, getBigDecimalArray, getBigDecimalArray, getBigIntegerArray, getBigIntegerArray, getBigIntegerArray, getBooleanArray, getBooleanArray, getBooleanArray, getByteArray, getByteArray, getByteArray, getCharArray, getCharArray, getCharArray, getConstantColumnValue, getDbColumnName, getDoubleArray, getDoubleArray, getDoubleArray, getEnumFormatter, getFloatArray, getFloatArray, getFloatArray, getImports, getInstantArray, getIntArray, getIntArray, getIntArray, getLocalDateArray, getLocalDateArray, getLocalDateArray, getLocalTimeArray, getLocalTimeArray, getLocalTimeArray, getLongArray, getLongArray, getLongArray, getSetter, getShortArray, getShortArray, getShortArray, getStringArray, getStringArray, instantFromLong, instantFromTimestamp, instantFromTimestamp, localDateFromString, parseBoolean, processField, setImportProperties, stripFirstCharacter, toISONanos, updateWithConstantColumnValue
-
Constructor Details
-
BaseImportFieldWriter
- Parameters:
log- the passed-down loggerdbColumnName- the column namearrayDelimiter- the delimiter for array types (if applicable)
-
-
Method Details
-
getShort
@DynamicUse public static short getShort(@NotNull @NotNull String value, @Nullable @Nullable String columnName, @NotNull @NotNull Logger log, boolean strict, boolean failDefault, short onEmpty) Reads a short value from a CSVRecord- Parameters:
value- The value of the named column in the current row in the import filecolumnName- The column name from which the value should be readlog- The passed-down loggerstrict- Whether strict (true) or permissive (false) import rules are being usedfailDefault- Whether (true) to use the default value (onEmpty) if parsing/conversion of the source value failsonEmpty- A default value that may be used if the source is empty or parsing fails- Returns:
- the converted value, or the onEmpty value, depending on strict, failDefault, and the source value itself
-
getInt
@DynamicUse public static int getInt(@NotNull @NotNull String value, @Nullable @Nullable String columnName, @NotNull @NotNull Logger log, boolean strict, boolean failDefault, int onEmpty) Reads an int value from a CSVRecord- Parameters:
value- The value of the named column in the current row in the import filecolumnName- The column name from which the value should be readlog- The passed-down loggerstrict- Whether strict (true) or permissive (false) import rules are being usedfailDefault- Whether (true) to use the default value (onEmpty) if parsing/conversion of the source value failsonEmpty- A default value that may be used if the source is empty or parsing fails- Returns:
- the converted value, or the onEmpty value, depending on strict, failDefault, and the source value itself
-
getLong
@DynamicUse public static long getLong(@NotNull @NotNull String value, @Nullable @Nullable String columnName, @NotNull @NotNull Logger log, boolean strict, boolean failDefault, long onEmpty) Reads a long value from a CSVRecord- Parameters:
value- The value of the named column in the current row in the import filecolumnName- The column name from which the value should be readlog- The passed-down loggerstrict- Whether strict (true) or permissive (false) import rules are being usedfailDefault- Whether (true) to use the default value (onEmpty) if parsing/conversion of the source value failsonEmpty- A default value that may be used if the source is empty or parsing fails- Returns:
- the converted value, or the onEmpty value, depending on strict, failDefault, and the source value itself
-
getISONanos
@DynamicUse public static long getISONanos(@Nullable @Nullable String value, @Nullable @Nullable String columnName, @NotNull @NotNull Logger log, boolean strict, boolean failDefault, long onEmpty) Reads a ISO formatted date value from a CSVRecord and converts it to nanoseconds since the epoch. This parser is a little less strict than ISO, in that it will accept time zone offsets without colons.- Parameters:
value- The value of the named column in the current row in the import filecolumnName- The column name from which the value should be readlog- The passed-down loggerstrict- Whether strict (true) or permissive (false) import rules are being usedfailDefault- Whether (true) to use the default value (onEmpty) if parsing/conversion of the source value failsonEmpty- A default value that may be used if the source is empty or parsing fails- Returns:
- the converted value, or the onEmpty value, depending on strict, failDefault, and the source value itself
-
getDouble
@DynamicUse public static double getDouble(@NotNull @NotNull String value, @Nullable @Nullable String columnName, @NotNull @NotNull Logger log, boolean strict, boolean failDefault, double onEmpty) Reads a double value from a CSVRecord- Parameters:
value- The value of the named column in the current row in the import filecolumnName- The column name from which the value should be readlog- The passed-down loggerstrict- Whether strict (true) or permissive (false) import rules are being usedfailDefault- Whether (true) to use the default value (onEmpty) if parsing/conversion of the source value failsonEmpty- A default value that may be used if the source is empty or parsing fails- Returns:
- the converted value, or the onEmpty value, depending on strict, failDefault, and the source value itself
-
getBigDecimal
@DynamicUse public static BigDecimal getBigDecimal(@NotNull @NotNull String value, @Nullable @Nullable String columnName, @NotNull @NotNull Logger log, boolean strict, boolean failDefault, @Nullable @Nullable BigDecimal onEmpty) Reads a BigDecimal value from a CSVRecord- Parameters:
value- The value of the named column in the current row in the import filecolumnName- The column name from which the value should be readlog- The passed-down loggerstrict- Whether strict (true) or permissive (false) import rules are being usedfailDefault- Whether (true) to use the default value (onEmpty) if parsing/conversion of the source value failsonEmpty- A default value that may be used if the source is empty or parsing fails- Returns:
- the converted value, or the onEmpty value, depending on strict, failDefault, and the source value itself
-
getLocalDate
@DynamicUse public static LocalDate getLocalDate(@NotNull @NotNull String value, @Nullable @Nullable String columnName, @NotNull @NotNull Logger log, boolean strict, boolean failDefault, @Nullable @Nullable LocalDate onEmpty) Read a LocalDate value from a CSVRecord.- Parameters:
value- The value of the named column in the current row in the import filecolumnName- The column name from which the value should be readlog- The passed-down loggerstrict- Whether strict (true) or permissive (false) import rules are being usedfailDefault- Whether (true) to use the default value (onEmpty) if parsing/conversion of the source value failsonEmpty- A default value that may be used if the source is empty or parsing fails- Returns:
- the converted value, or the onEmpty value, depending on strict, failDefault, and the source value itself
-
getLocalTime
@DynamicUse public static LocalTime getLocalTime(@NotNull @NotNull String value, @Nullable @Nullable String columnName, @NotNull @NotNull Logger log, boolean strict, boolean failDefault, @Nullable @Nullable LocalTime onEmpty) Read a LocalTime value from a CSVRecord.- Parameters:
value- The value of the named column in the current row in the import filecolumnName- The column name from which the value should be readlog- The passed-down loggerstrict- Whether strict (true) or permissive (false) import rules are being usedfailDefault- Whether (true) to use the default value (onEmpty) if parsing/conversion of the source value failsonEmpty- A default value that may be used if the source is empty or parsing fails- Returns:
- the converted value, or the onEmpty value, depending on strict, failDefault, and the source value itself
-
getFloat
@DynamicUse public static float getFloat(@NotNull @NotNull String value, @Nullable @Nullable String columnName, @NotNull @NotNull Logger log, boolean strict, boolean failDefault, float onEmpty) Reads a float value from a CSVRecord- Parameters:
value- The value of the named column in the current row in the import filecolumnName- The column name from which the value should be readlog- The passed-down loggerstrict- Whether strict (true) or permissive (false) import rules are being usedfailDefault- Whether (true) to use the default value (onEmpty) if parsing/conversion of the source value failsonEmpty- A default value that may be used if the source is empty or parsing fails- Returns:
- the converted value, or the onEmpty value, depending on strict, failDefault, and the source value itself
-
getChar
@DynamicUse public static char getChar(@Nullable @Nullable String value, @Nullable @Nullable String columnName, @NotNull @NotNull Logger log, boolean strict, boolean failDefault, char onEmpty) Reads a char value from a CSVRecord- Parameters:
value- The value of the named column in the current row in the import filecolumnName- The column name from which the value should be readlog- The passed-down loggerstrict- Whether strict (true) or permissive (false) import rules are being usedfailDefault- Whether (true) to use the default value (onEmpty) if parsing/conversion of the source value failsonEmpty- A default value that may be used if the source is empty or parsing fails- Returns:
- the converted value, or the onEmpty value, depending on strict, failDefault, and the source value itself
-
getByte
@DynamicUse public static byte getByte(@Nullable @Nullable String value, @Nullable @Nullable String columnName, @NotNull @NotNull Logger log, boolean strict, boolean failDefault, byte onEmpty) Reads a byte value from a CSVRecord- Parameters:
value- The value of the named column in the current row in the import filecolumnName- The column name from which the value should be readlog- The passed-down loggerstrict- Whether strict (true) or permissive (false) import rules are being usedfailDefault- Whether (true) to use the default value (onEmpty) if parsing/conversion of the source value failsonEmpty- A default value that may be used if the source is empty or parsing fails- Returns:
- the converted value, or the onEmpty value, depending on strict, failDefault, and the source value itself
-
getTrimmedStringNull
@DynamicUse public static String getTrimmedStringNull(@Nullable @Nullable String value, @Nullable @Nullable String columnName) Reads a String value from a CSVRecord. Trims white space, and handles the special case of the word null being returned as a null String.- Parameters:
value- The value of the named column in the current row in the import filecolumnName- The column name from which the value should be read- Returns:
- the read value, or a null String if the field contains the keyword "null"
-
getBoolean
@DynamicUse public static Boolean getBoolean(@NotNull @NotNull String value, @Nullable @Nullable String columnName, @NotNull @NotNull Logger log, boolean strict, boolean failDefault, Boolean onEmpty) Reads a Boolean value from a CSVRecord. parseBoolean handles interpretation of various text boolean expressions (true, false, 1, 0, T, F, etc).- Parameters:
value- The value of the named column in the current row in the import filecolumnName- The column name from which the value should be readlog- The passed-down loggerstrict- Whether strict (true) or permissive (false) import rules are being usedfailDefault- Whether (true) to use the default value (onEmpty) if parsing/conversion of the source value failsonEmpty- A default value that may be used if the source is empty or parsing fails- Returns:
- the converted value, or the onEmpty value, depending on strict, failDefault, and the source value itself
-