Class InstantPatternDynamicFormatter.StaticPatternSequence
- java.lang.Object
-
- org.apache.logging.log4j.core.util.internal.instant.InstantPatternDynamicFormatter.PatternSequence
-
- org.apache.logging.log4j.core.util.internal.instant.InstantPatternDynamicFormatter.StaticPatternSequence
-
- Enclosing class:
- InstantPatternDynamicFormatter
static final class InstantPatternDynamicFormatter.StaticPatternSequence extends InstantPatternDynamicFormatter.PatternSequence
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringliteral-
Fields inherited from class org.apache.logging.log4j.core.util.internal.instant.InstantPatternDynamicFormatter.PatternSequence
pattern, precision
-
-
Constructor Summary
Constructors Constructor Description StaticPatternSequence(java.lang.String literal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) InstantPatternFormattercreateFormatter(java.util.Locale locale, java.util.TimeZone timeZone)(package private) @Nullable InstantPatternDynamicFormatter.PatternSequencetryMerge(InstantPatternDynamicFormatter.PatternSequence other, java.time.temporal.ChronoUnit thresholdPrecision)Tries to merge two pattern sequences.-
Methods inherited from class org.apache.logging.log4j.core.util.internal.instant.InstantPatternDynamicFormatter.PatternSequence
equals, escapeLiteral, hashCode, isConstantForDurationOf, mergePatterns, toString
-
-
-
-
Method Detail
-
createFormatter
InstantPatternFormatter createFormatter(java.util.Locale locale, java.util.TimeZone timeZone)
- Specified by:
createFormatterin classInstantPatternDynamicFormatter.PatternSequence
-
tryMerge
@Nullable InstantPatternDynamicFormatter.PatternSequence tryMerge(InstantPatternDynamicFormatter.PatternSequence other, java.time.temporal.ChronoUnit thresholdPrecision)
Description copied from class:InstantPatternDynamicFormatter.PatternSequenceTries to merge two pattern sequences.If not {@link null}, the pattern sequence returned by this method must:
- Have a
InstantPatternDynamicFormatter.PatternSequence.precision, which is the minimum of the precisions of the two merged sequences. - Create formatters that are equivalent to the concatenation of the formatters produced by the two merged sequences.
The returned pattern sequence should try to achieve these two goals:
- Create formatters which are faster than the concatenation of the formatters produced by the two merged sequences.
-
It should be {@link null} if one of the pattern sequences is effectively constant over
thresholdPrecision, but the other one is not.
- Specified by:
tryMergein classInstantPatternDynamicFormatter.PatternSequence- Parameters:
other- A pattern sequence.thresholdPrecision- A precision threshold to determine effectively constant sequences. This prevents merging effectively constant and dynamic pattern sequences.- Returns:
- A merged formatter factory or
nullif merging is not possible.
- Have a
-
-