Class DefaultPresetTemporalFormatter
java.lang.Object
de.xima.fc.common.time.DefaultPresetTemporalFormatter
- All Implemented Interfaces:
IPresetTemporalFormatter
public final class DefaultPresetTemporalFormatter
extends Object
implements IPresetTemporalFormatter
Default implementation of
IPresetTemporalFormatter that provides a builder for formatting temporal objects
(like dates and times) into localized strings using predefined styles. Uses DateTimeFormatter to format the
temporal objects based on the specified style.
Allows specifying the default locale and zone provided at construction time.
- Since:
- 8.4.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets a builder for formatting a temporal object into a localized string.static IPresetTemporalFormatterrootUtc()Gets a preset formatter that uses the root locale and UTC as a fallback.static IPresetTemporalFormattersystem()Gets a preset formatter that uses the system default locale and zone as a fallback.
-
Constructor Details
-
DefaultPresetTemporalFormatter
-
-
Method Details
-
forStyle
Description copied from interface:IPresetTemporalFormatterGets a builder for formatting a temporal object into a localized string. Allows configuring various options. The returned builder is not thread-safe and should be used in a single thread only.- Specified by:
forStylein interfaceIPresetTemporalFormatter- Parameters:
style- The style to use for formatting, never null.- Returns:
- A builder for formatting a temporal object into a localized string, never null.
-
rootUtc
Gets a preset formatter that uses the root locale and UTC as a fallback.- Returns:
- A preset formatter that uses the root locale and UTC as a fallback, never null.
-
system
Gets a preset formatter that uses the system default locale and zone as a fallback.- Returns:
- A preset formatter that uses the system default locale and zone as a fallback, never null.
-