Class InstantFormatter
- java.lang.Object
-
- org.apache.logging.log4j.layout.template.json.util.InstantFormatter
-
@Deprecated public final class InstantFormatter extends java.lang.ObjectDeprecated.Starting with version2.25.0, this class is planned to be removed in the next major release.A compositeInstantformatter trying to employ eitherFixedDateFormat,FastDateFormat, orDateTimeFormatterin the given order due to performance reasons.Note that
FixedDateFormatandFastDateFormatonly support millisecond precision. If the pattern asks for a higher precision,DateTimeFormatterwill be employed, which is significantly slower.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInstantFormatter.BuilderDeprecated.private static interfaceInstantFormatter.FormatterDeprecated.private static interfaceInstantFormatter.FormatterFactoryDeprecated.private static classInstantFormatter.JavaDateTimeFormatterDeprecated.private static classInstantFormatter.JavaDateTimeFormatterFactoryDeprecated.private static classInstantFormatter.Log4jFastFormatterDeprecated.private static classInstantFormatter.Log4jFastFormatterFactoryDeprecated.private static classInstantFormatter.Log4jFixedFormatterDeprecated.private static classInstantFormatter.Log4jFixedFormatterFactoryDeprecated.
-
Field Summary
Fields Modifier and Type Field Description private InstantFormatter.FormatterformatterDeprecated.private static InstantFormatter.FormatterFactory[]FORMATTER_FACTORIESDeprecated.The list of formatter factories in decreasing efficiency order.private static StatusLoggerLOGGERDeprecated.
-
Constructor Summary
Constructors Modifier Constructor Description privateInstantFormatter(InstantFormatter.Builder builder)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Stringformat(Instant instant)Deprecated.voidformat(Instant instant, java.lang.StringBuilder stringBuilder)Deprecated.java.lang.Class<?>getInternalImplementationClass()Deprecated.booleanisInstantMatching(Instant instant1, Instant instant2)Deprecated.Checks if the givenInstants are equal from the point of view of the employed formatter.static InstantFormatter.BuildernewBuilder()Deprecated.private static booleanpatternSupported(java.lang.String pattern, java.util.Locale locale, java.util.TimeZone timeZone, InstantFormatter.Formatter formatter)Deprecated.Checks if the provided formatter output matches with the one generated byDateTimeFormatter.
-
-
-
Field Detail
-
LOGGER
private static final StatusLogger LOGGER
Deprecated.
-
FORMATTER_FACTORIES
private static final InstantFormatter.FormatterFactory[] FORMATTER_FACTORIES
Deprecated.The list of formatter factories in decreasing efficiency order.
-
formatter
private final InstantFormatter.Formatter formatter
Deprecated.
-
-
Constructor Detail
-
InstantFormatter
private InstantFormatter(InstantFormatter.Builder builder)
Deprecated.
-
-
Method Detail
-
format
public java.lang.String format(Instant instant)
Deprecated.
-
format
public void format(Instant instant, java.lang.StringBuilder stringBuilder)
Deprecated.
-
isInstantMatching
public boolean isInstantMatching(Instant instant1, Instant instant2)
Deprecated.Checks if the givenInstants are equal from the point of view of the employed formatter.This method should be preferred over
Instant#equals(Object). For instance,FixedDateFormatandFastDateFormatdiscard nanoseconds, hence, from their point of view, two differentInstants are equal if they match up to millisecond precision.
-
getInternalImplementationClass
public java.lang.Class<?> getInternalImplementationClass()
Deprecated.
-
newBuilder
public static InstantFormatter.Builder newBuilder()
Deprecated.
-
patternSupported
private static boolean patternSupported(java.lang.String pattern, java.util.Locale locale, java.util.TimeZone timeZone, InstantFormatter.Formatter formatter)Deprecated.Checks if the provided formatter output matches with the one generated byDateTimeFormatter.
-
-