Interface DateTimeFormatterInterface
-
- All Known Implementing Classes:
DateTimeFormatterService
,DateTimeFormatterTool
public interface DateTimeFormatterInterface
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends TemporalAccessor>
Stringformat(T temporalAccessor)
Formats the given datetime as a String with the #DateTimeFormatterService.defaultFormat
.<T extends TemporalAccessor>
Stringformat(T temporalAccessor, String dateFormatString)
Formats the given date as a String.<T extends TemporalAccessor>
Stringformat(T temporalAccessor, String dateFormatString, Locale locale)
Formats the given date as a String.String
getDateTimeFormatPattern()
DateTimeFormatter
getDefaultFormat()
String
map(String src, String outgoingFormatPattern, Locale locale, String incomingFormatPattern)
Maps from an incoming format to an outgoing formatDateTimeFormatter
.String
map(String src, DateTimeFormatter outgoingFormat, Locale locale)
String
map(String src, DateTimeFormatter outgoingFormat, Locale locale, DateTimeFormatter incomingFormat)
Uses as incoming format#defaultFormat
and no locale.String
mapFrom(String src, DateTimeFormatter incomingFormat)
Uses as incomingDateTimeFormatter
#defaultFormat
.String
mapTo(String src, DateTimeFormatter outgoingFormat)
Uses as outgoingDateTimeFormatter
#defaultFormat
and no locale.
-
-
-
Method Detail
-
getDefaultFormat
DateTimeFormatter getDefaultFormat()
-
getDateTimeFormatPattern
String getDateTimeFormatPattern()
-
format
<T extends TemporalAccessor> String format(T temporalAccessor)
Formats the given datetime as a String with the #DateTimeFormatterService.defaultFormat
. using the default date format.- Parameters:
the
-to format
- Returns:
- String value of the date
-
format
<T extends TemporalAccessor> String format(T temporalAccessor, String dateFormatString)
Formats the given date as a String.- Parameters:
the
- TimeDate date to formatdateFormatString
- format string to use. SeeDateTimeFormatter
for details.- Returns:
- String value of the date
-
format
<T extends TemporalAccessor> String format(T temporalAccessor, String dateFormatString, Locale locale)
Formats the given date as a String.- Parameters:
the
- TimeDate date to formatdateFormatString
- format string to use. SeeDateTimeFormatter
for details.locale
-- Returns:
- String value of the date
-
map
String map(String src, String outgoingFormatPattern, Locale locale, String incomingFormatPattern)
Maps from an incoming format to an outgoing formatDateTimeFormatter
.- Parameters:
src
- the formatted datetimeoutgoingFormat
-DateTimeFormatter
locale
- Locale, if needed for outgoing formatting, no default.incomingFormat
-DateTimeFormatter
, optional, default is#defaultFormat
.- Returns:
- the newly mapped
-
map
String map(String src, DateTimeFormatter outgoingFormat, Locale locale, DateTimeFormatter incomingFormat)
Uses as incoming format#defaultFormat
and no locale.- Parameters:
src
-outgoingFormat
-- Returns:
- the formatted string
- Throws:
UnsupportedTemporalTypeException
-
mapTo
String mapTo(String src, DateTimeFormatter outgoingFormat)
Uses as outgoingDateTimeFormatter
#defaultFormat
and no locale.- Parameters:
src
- the datetime formatted stringincomingFormat
- the format of this string- Returns:
- the date time formatted using the
#defaultFormat
.
-
mapFrom
String mapFrom(String src, DateTimeFormatter incomingFormat)
Uses as incomingDateTimeFormatter
#defaultFormat
.- Parameters:
src
- the datetime formatted stringoutgoingFormat
- the format to which this string should be formatted.locale
-- Returns:
- the newly formatted date time string
- Throws:
UnsupportedTemporalTypeException
-
map
String map(String src, DateTimeFormatter outgoingFormat, Locale locale)
-
-