Interface ValueFormatProvider
-
public interface ValueFormatProviderHelper interface providing format for preparing values to be printed somewhere in a human-readable manner- Author:
- vbedrosova TODO: extract the constants to Open API and use them everywhere
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classValueFormatProvider.PercentFormatstatic classValueFormatProvider.SizeFormat
-
Field Summary
Fields Modifier and Type Field Description static StringDURATION_FORMATValue is treated as milliseconds and is formatted usingDurationDateFormatstatic StringINTEGER_FORMATValue is treated as integerstatic StringPERCENT_FORMATValue is treated as N%static StringSIZE_FORMATValue is treated as size in bytes and is formatted using suffixes like b, kb, Mb, Gb...static StringSUCCESS_RATE_FORMATValue is treated (N * 100)%static StringTEXT_FORMATValue is treated as float, no formatting performed
-
Method Summary
Static Methods Modifier and Type Method Description static FormatdecodeFormatString(String formatName)Returns format for the specified value.
-
-
-
Field Detail
-
DURATION_FORMAT
static final String DURATION_FORMAT
Value is treated as milliseconds and is formatted usingDurationDateFormat- See Also:
- Constant Field Values
-
SIZE_FORMAT
static final String SIZE_FORMAT
Value is treated as size in bytes and is formatted using suffixes like b, kb, Mb, Gb...- See Also:
- Constant Field Values
-
INTEGER_FORMAT
static final String INTEGER_FORMAT
Value is treated as integer- See Also:
- Constant Field Values
-
PERCENT_FORMAT
static final String PERCENT_FORMAT
Value is treated as N%- See Also:
- Constant Field Values
-
SUCCESS_RATE_FORMAT
static final String SUCCESS_RATE_FORMAT
Value is treated (N * 100)%- See Also:
- Constant Field Values
-
TEXT_FORMAT
static final String TEXT_FORMAT
Value is treated as float, no formatting performed- See Also:
- Constant Field Values
-
-
Method Detail
-
decodeFormatString
@NotNull static Format decodeFormatString(@Nullable String formatName)
Returns format for the specified value. For the supported values seeDURATION_FORMAT,SIZE_FORMAT,INTEGER_FORMAT,PERCENT_FORMAT,SUCCESS_RATE_FORMAT. By default returnsNumberFormat.getInstance()- Parameters:
formatName-- Returns:
- see above
-
-