Package org.apache.calcite.util.format
Interface FormatElement
- All Known Implementing Classes:
FormatElementEnum
public interface FormatElement
A format element in a format string. Knows how to parse and unparse itself.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
flatten
(Consumer<FormatElement> consumer) Applies a consumer to a format element.Formats a date to its appropriate string representation for the element.Returns the description of an element.
-
Method Details
-
format
Formats a date to its appropriate string representation for the element.This API is subject to change. It might be more efficient if the signature was one of the following:
void format(StringBuilder, java.util.Date) void format(StringBuilder, long)
-
getDescription
String getDescription()Returns the description of an element.For example,
%H
in MySQL represents the hour in 24-hour format (e.g., 00..23). This method returns the string "The hour (24-hour clock) as a decimal number (00-23)", which is the description ofFormatElementEnum.HH24
. -
flatten
Applies a consumer to a format element.
-