Package org.apache.commons.lang3.text
Class FormattableUtils
java.lang.Object
org.apache.commons.lang3.text.FormattableUtils
Deprecated.
As of 3.6, use Apache Commons Text
 
 FormattableUtils instead
Provides utilities for working with the 
Formattable interface.
 The Formattable interface provides basic control over formatting
 when using a Formatter. It is primarily concerned with numeric precision
 and padding, and is not designed to allow generalised alternate formats.
- Since:
- 3.0
- 
Constructor SummaryConstructorsConstructorDescriptionDeprecated.FormattableUtilsinstances should NOT be constructed in standard programming.
- 
Method SummaryModifier and TypeMethodDescriptionstatic Formatterappend(CharSequence seq, Formatter formatter, int flags, int width, int precision) Deprecated.Handles the commonFormattableoperations of truncate-pad-append, with no ellipsis on precision overflow, and padding width underflow with spaces.static Formatterappend(CharSequence seq, Formatter formatter, int flags, int width, int precision, char padChar) Deprecated.Handles the commonFormattableoperations of truncate-pad-append, with no ellipsis on precision overflow.static Formatterappend(CharSequence seq, Formatter formatter, int flags, int width, int precision, char padChar, CharSequence ellipsis) Deprecated.Handles the commonFormattableoperations of truncate-pad-append.static Formatterappend(CharSequence seq, Formatter formatter, int flags, int width, int precision, CharSequence ellipsis) Deprecated.Handles the commonFormattableoperations of truncate-pad-append, padding width underflow with spaces.static StringtoString(Formattable formattable) Deprecated.Gets the default formatted representation of the specifiedFormattable.
- 
Constructor Details- 
FormattableUtilspublic FormattableUtils()Deprecated.FormattableUtilsinstances should NOT be constructed in standard programming. Instead, the methods of the class should be invoked statically.This constructor is public to permit tools that require a JavaBean instance to operate. 
 
- 
- 
Method Details- 
appendpublic static Formatter append(CharSequence seq, Formatter formatter, int flags, int width, int precision) Deprecated.Handles the commonFormattableoperations of truncate-pad-append, with no ellipsis on precision overflow, and padding width underflow with spaces.- Parameters:
- seq- the string to handle, not null
- formatter- the destination formatter, not null
- flags- the flags for formatting, see- Formattable
- width- the width of the output, see- Formattable
- precision- the precision of the output, see- Formattable
- Returns:
- the formatterinstance, not null
 
- 
appendpublic static Formatter append(CharSequence seq, Formatter formatter, int flags, int width, int precision, char padChar) Deprecated.Handles the commonFormattableoperations of truncate-pad-append, with no ellipsis on precision overflow.- Parameters:
- seq- the string to handle, not null
- formatter- the destination formatter, not null
- flags- the flags for formatting, see- Formattable
- width- the width of the output, see- Formattable
- precision- the precision of the output, see- Formattable
- padChar- the pad character to use
- Returns:
- the formatterinstance, not null
 
- 
appendpublic static Formatter append(CharSequence seq, Formatter formatter, int flags, int width, int precision, char padChar, CharSequence ellipsis) Deprecated.Handles the commonFormattableoperations of truncate-pad-append.- Parameters:
- seq- the string to handle, not null
- formatter- the destination formatter, not null
- flags- the flags for formatting, see- Formattable
- width- the width of the output, see- Formattable
- precision- the precision of the output, see- Formattable
- padChar- the pad character to use
- ellipsis- the ellipsis to use when precision dictates truncation, null or empty causes a hard truncation
- Returns:
- the formatterinstance, not null
 
- 
appendpublic static Formatter append(CharSequence seq, Formatter formatter, int flags, int width, int precision, CharSequence ellipsis) Deprecated.Handles the commonFormattableoperations of truncate-pad-append, padding width underflow with spaces.- Parameters:
- seq- the string to handle, not null
- formatter- the destination formatter, not null
- flags- the flags for formatting, see- Formattable
- width- the width of the output, see- Formattable
- precision- the precision of the output, see- Formattable
- ellipsis- the ellipsis to use when precision dictates truncation, null or empty causes a hard truncation
- Returns:
- the formatterinstance, not null
 
- 
toStringDeprecated.Gets the default formatted representation of the specifiedFormattable.- Parameters:
- formattable- the instance to convert to a string, not null
- Returns:
- the resulting string, not null
 
 
-