Class TemporalText

java.lang.Object
dev.frostlake.values.TemporalText

public final class TemporalText extends Object
How 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 Details

    • appendEraYear

      public static DateTimeFormatterBuilder appendEraYear(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.
      Parameters:
      builder - the formatter under construction
      Returns:
      the same builder
    • wireValue

      public static Object wireValue(Object value, DataType declared)
      The value a JSON wire should carry for a column of declared: 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

      public static String wireText(Object value, DataType declared)
      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 what getString shows.
    • displayOfWire

      public static String displayOfWire(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 what getString shows — three digits for a timestamp, none for a TIME. Text of any other shape passes through.
      Parameters:
      wire - the cell's transport text
      typeName - the column's declared type name
      Returns:
      the display text
    • render

      public static String render(Object value, DataType declared)
      value as getString should report it for a column of declared, 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 to toString, which is what every caller did before this existed.