Class TemporalText
getString renders a temporal cell, per DECLARED type — measured against a real account's
driver, which is the thing a caller compares Frostlake to:
DATE 2026-08-07 TIME 12:34:56 no fractional part, ever TIMESTAMP_NTZ 2026-08-07 12:34:56.789 TIMESTAMP_LTZ 2026-08-07 12:34:56.789 -0700 TIMESTAMP_TZ 2026-08-07 12:34:56.789 -0700 same as LTZ
Three details that only measuring gives you. TIME drops its fraction entirely — a
TIME(9) holding 12:34:56.123456789 still reads 12:34:56. A timestamp always
shows exactly three fractional digits: zero-PADDED (.1 reads .100) and
TRUNCATED (.123456789 reads .123), never trimmed to significant digits. And the two
zoned types are indistinguishable here, both carrying a numeric ±HHMM offset.
Driven by the declared type rather than the Java class, because the same class serves several
types: a TIMESTAMP_LTZ cell and a TIMESTAMP_NTZ cell are both LocalDateTime in this engine,
and only the column knows which one wants an offset. A value that is already text passes straight
through, as does anything whose column is not temporal.
-
Method Summary
Modifier and TypeMethodDescriptionstatic DateTimeFormatterBuilderappendEraYear(DateTimeFormatterBuilder builder) The YEAR element as the account prints it in every text of a date or a timestamp: the year of the era, four digits at least, never signed — see SharedFunctionHelpers#yearText for the same rule as a text.static StringdisplayOfWire(String wire, String typeName) The display text of a temporal cell as the wire carries it (wireText(java.lang.Object, dev.frostlake.types.DataType)): the fraction cut back to whatgetStringshows — three digits for a timestamp, none for a TIME.static StringvalueasgetStringshould report it for a column ofdeclared, or null when the value is null.static StringThe TRANSPORT text of a temporal cell:render(java.lang.Object, dev.frostlake.types.DataType)'s shape with nothing cut from the fraction of a second.static ObjectThe value a JSON wire should carry for a column ofdeclared: a temporal cell as its transport text, and anything else UNTOUCHED.
-
Method Details
-
appendEraYear
The YEAR element as the account prints it in every text of a date or a timestamp: the year of the era, four digits at least, never signed — see SharedFunctionHelpers#yearText for the same rule as a text.- Parameters:
builder- the formatter under construction- Returns:
- the same builder
-
wireValue
The value a JSON wire should carry for a column ofdeclared: a temporal cell as its transport text, and anything else UNTOUCHED.Untouched matters. Rendering every cell would cross a number as the string
"42.0", and the far side would fail to read it as an int — the wire keeps JSON's own types for everything this class has no opinion about. -
wireText
The TRANSPORT text of a temporal cell:render(java.lang.Object, dev.frostlake.types.DataType)'s shape with nothing cut from the fraction of a second. A timestamp carries three, six or nine fractional digits — as many as its value needs and never fewer than three, so a whole millisecond crosses exactly as its display text — and a TIME with a fraction carries it after the seconds. The display form is a lossy rendering; a transport that carried it could never hand a client the value.displayOfWire(java.lang.String, java.lang.String)cuts the text back to whatgetStringshows. -
displayOfWire
The display text of a temporal cell as the wire carries it (wireText(java.lang.Object, dev.frostlake.types.DataType)): the fraction cut back to whatgetStringshows — three digits for a timestamp, none for a TIME. Text of any other shape passes through.- Parameters:
wire- the cell's transport texttypeName- the column's declared type name- Returns:
- the display text
-
render
valueasgetStringshould report it for a column ofdeclared, or null when the value is null. Anything this cannot place — a non-temporal column, a cell already carrying text, a temporal class not modelled here — falls back totoString, which is what every caller did before this existed.
-