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
FieldsFields inherited from class org.apache.logging.log4j.core.util.internal.instant.InstantPatternDynamicFormatter.PatternSequence
pattern, precision -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) InstantPatternFormattercreateFormatter(Locale locale, TimeZone timeZone) (package private) @Nullable InstantPatternDynamicFormatter.PatternSequencetryMerge(InstantPatternDynamicFormatter.PatternSequence other, 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
-
Field Details
-
literal
-
-
Constructor Details
-
StaticPatternSequence
StaticPatternSequence(String literal)
-
-
Method Details
-
createFormatter
- Specified by:
createFormatterin classInstantPatternDynamicFormatter.PatternSequence
-
tryMerge
@Nullable InstantPatternDynamicFormatter.PatternSequence tryMerge(InstantPatternDynamicFormatter.PatternSequence other, ChronoUnit thresholdPrecision) Description copied from class:InstantPatternDynamicFormatter.PatternSequenceTries to merge two pattern sequences.If not
}, the pattern sequence returned by this method must:invalid @link
{@link null- 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
} if one of the pattern sequences is effectively constant over
invalid @link
{@link nullthresholdPrecision, 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
-