Class InstantPatternLegacyFormatter
- java.lang.Object
-
- org.apache.logging.log4j.core.util.internal.instant.InstantPatternLegacyFormatter
-
- All Implemented Interfaces:
InstantFormatter,InstantPatternFormatter
final class InstantPatternLegacyFormatter extends java.lang.Object implements InstantPatternFormatter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.util.internal.instant.InstantPatternFormatter
InstantPatternFormatter.Builder
-
-
Field Summary
Fields Modifier and Type Field Description private BiConsumer<java.lang.StringBuilder,Instant>formatterprivate java.util.Localelocaleprivate java.lang.Stringpatternprivate java.time.temporal.ChronoUnitprecisionprivate java.util.TimeZonetimeZone-
Fields inherited from interface org.apache.logging.log4j.core.util.internal.instant.InstantPatternFormatter
LEGACY_FORMATTERS_ENABLED
-
-
Constructor Summary
Constructors Constructor Description InstantPatternLegacyFormatter(java.lang.String pattern, java.util.Locale locale, java.util.TimeZone timeZone)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static BiConsumer<java.lang.StringBuilder,Instant>adaptFixedFormatter(FixedDateFormat formatter)private static BiConsumer<java.lang.StringBuilder,Instant>createFastFormatter(java.lang.String pattern, java.util.Locale locale, java.util.TimeZone timeZone)private static BiConsumer<java.lang.StringBuilder,Instant>createFormatter(java.lang.String pattern, java.util.Locale locale, java.util.TimeZone timeZone)voidformatTo(java.lang.StringBuilder buffer, Instant instant)java.util.LocalegetLocale()java.lang.StringgetPattern()java.time.temporal.ChronoUnitgetPrecision()java.util.TimeZonegetTimeZone()private static <V> java.util.function.Supplier<V>memoryEfficientInstanceSupplier(java.util.function.Supplier<V> supplier)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.logging.log4j.core.util.internal.instant.InstantFormatter
format
-
-
-
-
Field Detail
-
precision
private final java.time.temporal.ChronoUnit precision
-
pattern
private final java.lang.String pattern
-
locale
private final java.util.Locale locale
-
timeZone
private final java.util.TimeZone timeZone
-
formatter
private final BiConsumer<java.lang.StringBuilder,Instant> formatter
-
-
Method Detail
-
createFormatter
private static BiConsumer<java.lang.StringBuilder,Instant> createFormatter(java.lang.String pattern, java.util.Locale locale, java.util.TimeZone timeZone)
-
adaptFixedFormatter
private static BiConsumer<java.lang.StringBuilder,Instant> adaptFixedFormatter(FixedDateFormat formatter)
-
createFastFormatter
private static BiConsumer<java.lang.StringBuilder,Instant> createFastFormatter(java.lang.String pattern, java.util.Locale locale, java.util.TimeZone timeZone)
-
memoryEfficientInstanceSupplier
private static <V> java.util.function.Supplier<V> memoryEfficientInstanceSupplier(java.util.function.Supplier<V> supplier)
-
getPrecision
public java.time.temporal.ChronoUnit getPrecision()
- Specified by:
getPrecisionin interfaceInstantFormatter- Returns:
- the time precision of the formatted output
-
formatTo
public void formatTo(java.lang.StringBuilder buffer, Instant instant)- Specified by:
formatToin interfaceInstantFormatter
-
getPattern
public java.lang.String getPattern()
- Specified by:
getPatternin interfaceInstantPatternFormatter
-
getLocale
public java.util.Locale getLocale()
- Specified by:
getLocalein interfaceInstantPatternFormatter
-
getTimeZone
public java.util.TimeZone getTimeZone()
- Specified by:
getTimeZonein interfaceInstantPatternFormatter
-
-