Class EqualsBaseReplacementConverter
- java.lang.Object
-
- org.apache.logging.log4j.core.pattern.AbstractPatternConverter
-
- org.apache.logging.log4j.core.pattern.LogEventPatternConverter
-
- org.apache.logging.log4j.core.pattern.EqualsBaseReplacementConverter
-
- All Implemented Interfaces:
PatternConverter
- Direct Known Subclasses:
EqualsIgnoreCaseReplacementConverter
,EqualsReplacementConverter
public abstract class EqualsBaseReplacementConverter extends LogEventPatternConverter
Equals pattern converter.
-
-
Field Summary
-
Fields inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter
LOGGER
-
Fields inherited from interface org.apache.logging.log4j.core.pattern.PatternConverter
CATEGORY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EqualsBaseReplacementConverter(String name, String style, List<PatternFormatter> formatters, String testString, String substitution, PatternParser parser)
Construct the converter.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract boolean
equals(String str, StringBuilder buff, int from, int len)
Returns true if the specified String equals the specified section of the specified StringBuilder.void
format(LogEvent event, StringBuilder toAppendTo)
Formats an event into a string buffer.-
Methods inherited from class org.apache.logging.log4j.core.pattern.LogEventPatternConverter
format, handlesThrowable, isVariable
-
Methods inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter
getName, getStyleClass
-
-
-
-
Constructor Detail
-
EqualsBaseReplacementConverter
protected EqualsBaseReplacementConverter(String name, String style, List<PatternFormatter> formatters, String testString, String substitution, PatternParser parser)
Construct the converter.- Parameters:
name
- converter namestyle
- converter styleformatters
- The PatternFormatters to generate the text to manipulate.testString
- The test string.substitution
- The substitution string.parser
- The PatternParser.
-
-
Method Detail
-
format
public void format(LogEvent event, StringBuilder toAppendTo)
Formats an event into a string buffer.- Specified by:
format
in classLogEventPatternConverter
- Parameters:
event
- event to format, may not be null.toAppendTo
- string buffer to which the formatted event will be appended. May not be null.
-
equals
protected abstract boolean equals(String str, StringBuilder buff, int from, int len)
Returns true if the specified String equals the specified section of the specified StringBuilder.- Parameters:
str
- the String to comparebuff
- the StringBuilder to compare a section offrom
- start index in the StringBuilderlen
- length of the section in the StringBuilder- Returns:
- true if equal, false otherwise
-
-