Package de.xima.fc.common.time
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 ofIPresetTemporalFormatterthat provides a builder for formatting temporal objects (like dates and times) into localized strings using predefined styles. UsesDateTimeFormatterto 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 Constructor Description DefaultPresetTemporalFormatter(Locale defaultLocale, ZoneId defaultZone)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IPresetTemporalFormatterBuilderforStyle(EPresetTemporalFormatStyle style)Gets 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.
-
-
-
Method Detail
-
forStyle
public IPresetTemporalFormatterBuilder forStyle(EPresetTemporalFormatStyle style)
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
public static IPresetTemporalFormatter 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
public static IPresetTemporalFormatter 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.
-
-