Interface ValueFormatProvider
-
public interface ValueFormatProvider
Helper 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 class
ValueFormatProvider.PercentFormat
static class
ValueFormatProvider.SizeFormat
-
Field Summary
Fields Modifier and Type Field Description static String
DURATION_FORMAT
Value is treated as milliseconds and is formatted usingDurationDateFormat
static String
INTEGER_FORMAT
Value is treated as integerstatic String
PERCENT_FORMAT
Value is treated as N%static String
SIZE_FORMAT
Value is treated as size in bytes and is formatted using suffixes like b, kb, Mb, Gb...static String
SUCCESS_RATE_FORMAT
Value is treated (N * 100)%static String
TEXT_FORMAT
Value is treated as float, no formatting performed
-
Method Summary
Static Methods Modifier and Type Method Description static Format
decodeFormatString(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
-
-