org.apache.log4j.pattern

## Class ExtrasFormattingInfo

- java.lang.Object
- - org.apache.log4j.pattern.ExtrasFormattingInfo

-     public final class ExtrasFormattingInfo
      extends Object

  Modifies the output of a pattern converter for a specified minimum and maximum width and alignment.
  Author:
    Jim Cakalic, Ceki Gülcü, Curt Arnold

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExtrasFormattingInfo(boolean leftAlign, boolean rightTruncate, int minLength, int maxLength)` Creates new instance.
    `ExtrasFormattingInfo(boolean leftAlign, int minLength, int maxLength)` Deprecated. since 1.2.17

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `format(int fieldStart, StringBuffer buffer)` Adjust the content of the buffer based on the specified lengths and alignment.
    `static ExtrasFormattingInfo` | `getDefault()` Gets default instance.
    `int` | `getMaxLength()` Get maximum length.
    `int` | `getMinLength()` Get minimum length.
    `boolean` | `isLeftAligned()` Determine if left aligned.
    `boolean` | `isRightTruncated()` Determine if right truncated.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ExtrasFormattingInfo

          public ExtrasFormattingInfo(boolean leftAlign,
                              int minLength,
                              int maxLength)

      Deprecated. since 1.2.17
      Creates new instance.
      Parameters:
        `leftAlign` - left align if true.
        `minLength` - minimum length.
        `maxLength` - maximum length.

    - #### ExtrasFormattingInfo

          public ExtrasFormattingInfo(boolean leftAlign,
                              boolean rightTruncate,
                              int minLength,
                              int maxLength)

      Creates new instance.
      Parameters:
        `leftAlign` - left align if true.
        `rightTruncate` - right truncate if true.
        `minLength` - minimum length.
        `maxLength` - maximum length.
      Since:
        1.2.17

  - ### Method Detail

    - #### getDefault

          public static ExtrasFormattingInfo getDefault()

      Gets default instance.
      Returns:
        default instance.

    - #### isLeftAligned

          public boolean isLeftAligned()

      Determine if left aligned.
      Returns:
        true if left aligned.

    - #### isRightTruncated

          public boolean isRightTruncated()

      Determine if right truncated.
      Returns:
        true if right truncated.
      Since:
        1.2.17

    - #### 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,
                    StringBuffer 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.

Copyright © 2013 The Apache Software Foundation. Licensed under the Apache License, Version 2.0

Apache Extras for Apache log4j, Apache log4j and Apache are trademarks of the Apache Software Foundation.