Class QRecordToTsvAdapter
java.lang.Object
com.kingsrook.qqq.backend.core.adapters.QRecordToTsvAdapter
Class to convert QRecords to TSV (Tab Separated Value) Strings.
By default, escapes \n, \t, \r, and \ chars within values as \n, \t, \r, and \\
This behavior can be customized via sanitizationType property.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
options for how special-char values (\n, \t, \r, and \\) should be sanitized -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGetter for sanitizationTyperecordToTsv
(QTableMetaData table, QRecord record) Convert one record (with all of its table's fields) to TSV.recordToTsv
(QTableMetaData table, QRecord record, List<QFieldMetaData> fields) Convert one record (with all of its table's fields) to TSV, with a specified set of fields.void
setSanitizationType
(QRecordToTsvAdapter.SanitizationType sanitizationType) Setter for sanitizationTypewithSanitizationType
(QRecordToTsvAdapter.SanitizationType sanitizationType) Fluent setter for sanitizationType
-
Constructor Details
-
QRecordToTsvAdapter
public QRecordToTsvAdapter()
-
-
Method Details
-
recordToTsv
Convert one record (with all of its table's fields) to TSV.- Parameters:
table
- the table that the record is fromrecord
- the record full of values- Returns:
- TSV string - ENDING with newline (\n)!
-
recordToTsv
Convert one record (with all of its table's fields) to TSV, with a specified set of fields.- Parameters:
table
- the table that the record is fromrecord
- the record full of valuesfields
- list of fields to include. "joinTable.field" notation will work if the record contains joined fields.- Returns:
- TSV string - ENDING with newline (\n)!
-
getSanitizationType
Getter for sanitizationType- See Also:
-
setSanitizationType
Setter for sanitizationType- See Also:
-
withSanitizationType
public QRecordToTsvAdapter withSanitizationType(QRecordToTsvAdapter.SanitizationType sanitizationType) Fluent setter for sanitizationType- Parameters:
sanitizationType
- how tsv-special chars should be handled by this instance.- Returns:
- this
-