Package org.cyclos.utils
Interface Formatter
-
- All Known Implementing Classes:
AbstractFormatter,FormatterImpl,SmsOperationFormatterImpl
public interface FormatterContains methods used to format several types of data
-
-
Field Summary
Fields Modifier and Type Field Description static intVARIABLE_SCALEValue used when setting a number format with a custom scale, indicating that the scale is variable.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringformat(Boolean bool)Formats a booleanStringformat(Integer number)Formats an integer numberStringformat(Long number)Formats a long numberStringformat(Number size, FileSizeUnit unit)Formats a size showing its unitsStringformat(Object object)Tests the object type, invoking one of the specific format methodsStringformat(BigDecimal number, int scale)Formats a number with the given scaleStringformat(Collection<?> list)Formats a collection as a comma-separated string, invokingformat(Object)for each elementStringformat(AccountOwner accountOwner)Formats an account ownerStringformat(ICurrency currency, BigDecimal amount)Formats an amount with the given currencyStringformat(FormattableTimeBasedRate rate)Formats a time based rateStringformat(IBinaryFile file)Formats a binary fileStringformat(INamedEntity namedEntity)Formats a named entityStringformat(ICustomFieldPossibleValue<?> possibleValue)Formats a custom field possible valueStringformat(ICustomFieldValue<?,?,?,?> customFieldValue)Formats a custom field valueStringformat(IDynamicFieldValue dynamicValue)Formats a custom field dynamic valueStringformat(IImage image)Formats an imageStringformat(ProfileField profileField)Formats a user profile fieldStringformat(HasDisplay hasDisplay)Formats the given object as the display valueStringformat(ICurrencyAmount currencyAmount)Formats a currency amountStringformat(ICurrencyAmountRange range)Formats a currency amount rangeStringformat(IDatePeriod period)Formats a periodStringformat(IDecimalRange range, int scale)Formats a decimal range with the given scaleStringformat(IDimensions dimensions)Formats a dimensionsStringformat(IFileSize fileSize)Formats a file sizeStringformat(ILatLong latLong)Formats a geographical coordinateStringformat(ITimeInterval timeInterval)Formats a time intervalStringformat(Range<?> range)Formats a rangeStringformat(HasMessageKey objectWithKey)Formats an object that has a mapping to the translation message key.Stringformat(IDate date)Formats a date as date and timeStringformat(TranslationMessageSpecification tms)Formats a translation messageStringformatAsDate(IDatePeriod period)Formats a period as dateStringformatAsDate(IDate dateTime)Formats an IDate as dateStringformatAsTime(IDate dateTime)Formats an IDate as timeStringformatDuration(Long duration)Formats a duration (given in milliseconds) in a string like: 1h 12m 31sStringformatId(IEntity entity)Formats the entity identifierStringformatPercentage(Double number)Formats a percentage with variable scaleStringformatPercentage(Double number, int scale)Formats a percentage with the given decimal digitsStringformatPercentage(Integer value, Integer total)Formats a percentage without decimal fieldsStringformatPercentage(Integer value, Integer total, int scale)Formats a percentage with the given decimal digitsStringformatPercentage(BigDecimal number)Formats a percentage with variable scaleStringformatPercentage(BigDecimal number, int scale)Formats a percentage with the given decimal fieldsStringformatVariables(String text, Map<String,?> variables)Formats variables in form #name# with values retrieved from the given Map, keyed by the name (without #'s)StringgetDatePattern()Returns the date patternStringgetTimePattern()Returns the time pattern
-
-
-
Field Detail
-
VARIABLE_SCALE
static final int VARIABLE_SCALE
Value used when setting a number format with a custom scale, indicating that the scale is variable. For example, 1 is formatted as 1.0, 1.1 as 1.1, 1.123 as 1.123, etc.- See Also:
- Constant Field Values
-
-
Method Detail
-
format
String format(AccountOwner accountOwner)
Formats an account owner
-
format
String format(BigDecimal number, int scale)
Formats a number with the given scale
-
format
String format(Collection<?> list)
Formats a collection as a comma-separated string, invokingformat(Object)for each element
-
format
String format(FormattableTimeBasedRate rate)
Formats a time based rate
-
format
String format(HasDisplay hasDisplay)
Formats the given object as the display value
-
format
String format(HasMessageKey objectWithKey)
Formats an object that has a mapping to the translation message key.
-
format
String format(IBinaryFile file)
Formats a binary file
-
format
String format(ICurrency currency, BigDecimal amount)
Formats an amount with the given currency
-
format
String format(ICurrencyAmount currencyAmount)
Formats a currency amount
-
format
String format(ICurrencyAmountRange range)
Formats a currency amount range
-
format
String format(ICustomFieldPossibleValue<?> possibleValue)
Formats a custom field possible value
-
format
String format(ICustomFieldValue<?,?,?,?> customFieldValue)
Formats a custom field value
-
format
String format(IDatePeriod period)
Formats a period
-
format
String format(IDecimalRange range, int scale)
Formats a decimal range with the given scale
-
format
String format(IDimensions dimensions)
Formats a dimensions
-
format
String format(IDynamicFieldValue dynamicValue)
Formats a custom field dynamic value
-
format
String format(INamedEntity namedEntity)
Formats a named entity
-
format
String format(ITimeInterval timeInterval)
Formats a time interval
-
format
String format(Number size, FileSizeUnit unit)
Formats a size showing its units
-
format
String format(Object object)
Tests the object type, invoking one of the specific format methods
-
format
String format(ProfileField profileField)
Formats a user profile field
-
format
String format(TranslationMessageSpecification tms)
Formats a translation message
-
formatAsDate
String formatAsDate(IDatePeriod period)
Formats a period as date
-
formatDuration
String formatDuration(Long duration)
Formats a duration (given in milliseconds) in a string like: 1h 12m 31s
-
formatPercentage
String formatPercentage(BigDecimal number)
Formats a percentage with variable scale
-
formatPercentage
String formatPercentage(BigDecimal number, int scale)
Formats a percentage with the given decimal fields
-
formatPercentage
String formatPercentage(Double number, int scale)
Formats a percentage with the given decimal digits
-
formatPercentage
String formatPercentage(Integer value, Integer total)
Formats a percentage without decimal fields
-
formatPercentage
String formatPercentage(Integer value, Integer total, int scale)
Formats a percentage with the given decimal digits
-
formatVariables
String formatVariables(String text, Map<String,?> variables)
Formats variables in form #name# with values retrieved from the given Map, keyed by the name (without #'s)
-
getDatePattern
String getDatePattern()
Returns the date pattern
-
getTimePattern
String getTimePattern()
Returns the time pattern
-
-