public final class FormattingInfo extends Object
Modifier and Type | Field and Description |
---|---|
static FormattingInfo[] |
EMPTY_ARRAY
Empty array.
|
Constructor and Description |
---|
FormattingInfo(boolean leftAlign,
int minLength,
int maxLength,
boolean leftTruncate)
Creates new instance.
|
FormattingInfo(boolean leftAlign,
int minLength,
int maxLength,
boolean leftTruncate,
boolean zeroPad)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
format(int fieldStart,
StringBuilder buffer)
Adjust the content of the buffer based on the specified lengths and alignment.
|
static FormattingInfo |
getDefault()
Gets default instance.
|
int |
getMaxLength()
Get maximum length.
|
int |
getMinLength()
Get minimum length.
|
boolean |
isLeftAligned()
Determine if left aligned.
|
boolean |
isLeftTruncate()
Determine if left truncated.
|
boolean |
isZeroPad()
Determine if zero-padded.
|
String |
toString()
Returns a String suitable for debugging.
|
public static final FormattingInfo[] EMPTY_ARRAY
public FormattingInfo(boolean leftAlign, int minLength, int maxLength, boolean leftTruncate)
leftAlign
- left align if true.minLength
- minimum length.maxLength
- maximum length.leftTruncate
- truncates to the left if truepublic FormattingInfo(boolean leftAlign, int minLength, int maxLength, boolean leftTruncate, boolean zeroPad)
leftAlign
- left align if true.minLength
- minimum length.maxLength
- maximum length.leftTruncate
- truncates to the left if truezeroPad
- use zero-padding instead of whitespace-paddingpublic static FormattingInfo getDefault()
public boolean isLeftAligned()
public boolean isLeftTruncate()
public boolean isZeroPad()
public int getMinLength()
public int getMaxLength()
public void format(int fieldStart, StringBuilder buffer)
fieldStart
- start of field in buffer.buffer
- buffer to be modified. Copyright © 1999-2023 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.