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 Stringstatic StringformatDate(LocalDate date) static StringformatDateTime(LocalDateTime dateTime) static StringformatDateTimeWithZone(ZonedDateTime dateTime) static StringformatLocalTime(LocalTime localTime) static StringformatRecordLabel(QTableMetaData table, QRecord record) Make a string from a table's recordLabelFormat and fields, for a given record.static StringformatStringWithValues(String formatString, List<String> formatValues) For a given format string, and a list of values, apply the format.static StringformatValue(QFieldMetaData field, Serializable value) For a field, and its value, apply the field's displayFormat.static StringformatValue(String displayFormat, Serializable value) For a display format string (e.g., %d), and a value, apply the displayFormat.static voidsetBlobValuesToDownloadUrls(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 voidsetDisplayValuesInRecord(QTableMetaData table, Map<String, QFieldMetaData> fields, QRecord record) For a single record, set its display values - public version of this.static voidsetDisplayValuesInRecords(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 voidsetDisplayValuesInRecords(QTableMetaData table, Map<String, QFieldMetaData> fields, List<QRecord> records) For a list of records, set their recordLabels and display valuesstatic voidsetDisplayValuesInRecordsIncludingPossibleValueTranslations(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).
-
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
-
setDisplayValuesInRecordsIncludingPossibleValueTranslations
public static void setDisplayValuesInRecordsIncludingPossibleValueTranslations(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). -
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.
-