org.apache.logging.log4j.core.pattern
Class FormattingInfo

java.lang.Object
  extended by org.apache.logging.log4j.core.pattern.FormattingInfo

public final class FormattingInfo
extends Object

Modifies the output of a pattern converter for a specified minimum and maximum width and alignment.


Constructor Summary
FormattingInfo(boolean leftAlign, int minLength, int maxLength, boolean leftTruncate)
          Creates new instance.
 
Method Summary
 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.
 String toString()
          Returns a String suitable for debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormattingInfo

public FormattingInfo(boolean leftAlign,
                      int minLength,
                      int maxLength,
                      boolean leftTruncate)
Creates new instance.

Parameters:
leftAlign - left align if true.
minLength - minimum length.
maxLength - maximum length.
Method Detail

getDefault

public static FormattingInfo getDefault()
Gets default instance.

Returns:
default instance.

isLeftAligned

public boolean isLeftAligned()
Determine if left aligned.

Returns:
true if left aligned.

isLeftTruncate

public boolean isLeftTruncate()
Determine if left truncated.

Returns:
true if left truncated.

getMinLength

public int getMinLength()
Get minimum length.

Returns:
minimum length.

getMaxLength

public int getMaxLength()
Get maximum length.

Returns:
maximum length.

format

public void format(int fieldStart,
                   StringBuilder buffer)
Adjust the content of the buffer based on the specified lengths and alignment.

Parameters:
fieldStart - start of field in buffer.
buffer - buffer to be modified.

toString

public String toString()
Returns a String suitable for debugging.

Overrides:
toString in class Object
Returns:
a String suitable for debugging.


Copyright © 1999-2015 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.