Class InstantFormatter
java.lang.Object
org.apache.logging.log4j.layout.template.json.util.InstantFormatter
A composite
Instant formatter trying to employ either
FixedDateFormat, FastDateFormat, or DateTimeFormatter
in the given order due to performance reasons.
Note that FixedDateFormat and FastDateFormat only support
millisecond precision. If the pattern asks for a higher precision,
DateTimeFormatter will be employed, which is significantly slower.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidformat(Instant instant, StringBuilder stringBuilder) Class<?> booleanisInstantMatching(Instant instant1, Instant instant2) Checks if the givenInstants are equal from the point of view of the employed formatter.static InstantFormatter.Builder
-
Method Details
-
format
-
format
-
isInstantMatching
Checks if the givenInstants are equal from the point of view of the employed formatter.This method should be preferred over
. For instance,invalid reference
Instant#equals(Object)FixedDateFormatandFastDateFormatdiscard nanoseconds, hence, from their point of view, two differentInstants are equal if they match up to millisecond precision. -
getInternalImplementationClass
-
newBuilder
-