Class QValueFormatter
java.lang.Object
com.kingsrook.qqq.backend.core.actions.values.QValueFormatter
Utility to apply display formats to values for records and fields.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
static String
formatDate
(LocalDate date) static String
formatDateTime
(LocalDateTime dateTime) static String
formatDateTimeWithZone
(ZonedDateTime dateTime) static String
formatLocalTime
(LocalTime localTime) static String
formatRecordLabel
(QTableMetaData table, QRecord record) Make a string from a table's recordLabelFormat and fields, for a given record.static String
formatStringWithValues
(String formatString, List<String> formatValues) For a given format string, and a list of values, apply the format.static String
formatValue
(QFieldMetaData field, Serializable value) For a field, and its value, apply the field's displayFormat.static String
formatValue
(String displayFormat, Serializable value) For a display format string (e.g., %d), and a value, apply the displayFormat.static void
setBlobValuesToDownloadUrls
(QTableMetaData table, List<QRecord> records) For any BLOB type fields in the list of records, change their value to the URL where they can be downloaded, and set their display value to a file name.static void
setDisplayValuesInRecord
(QTableMetaData table, Map<String, QFieldMetaData> fields, QRecord record) For a single record, set its display values - public version of this.static void
setDisplayValuesInRecords
(QTableMetaData table, List<QRecord> records) For a list of records, set their recordLabels and display values - including record label (e.g., from the table meta data).static void
setDisplayValuesInRecords
(QTableMetaData table, Map<String, QFieldMetaData> fields, List<QRecord> records) For a list of records, set their recordLabels and display values
-
Constructor Details
-
QValueFormatter
public QValueFormatter()
-
-
Method Details
-
formatValue
For a field, and its value, apply the field's displayFormat. -
formatValue
For a display format string (e.g., %d), and a value, apply the displayFormat. -
formatDate
-
formatDateTime
-
formatDateTimeWithZone
-
formatLocalTime
-
formatRecordLabel
Make a string from a table's recordLabelFormat and fields, for a given record. -
formatStringWithValues
-
setDisplayValuesInRecords
For a list of records, set their recordLabels and display values - including record label (e.g., from the table meta data). -
setDisplayValuesInRecords
public static void setDisplayValuesInRecords(QTableMetaData table, Map<String, QFieldMetaData> fields, List<QRecord> records) For a list of records, set their recordLabels and display values -
setDisplayValuesInRecord
public static void setDisplayValuesInRecord(QTableMetaData table, Map<String, QFieldMetaData> fields, QRecord record) For a single record, set its display values - public version of this. -
formatBoolean
-
setBlobValuesToDownloadUrls
For any BLOB type fields in the list of records, change their value to the URL where they can be downloaded, and set their display value to a file name.
-