Interface ValueFormatTranslator
- All Known Implementing Classes:
ValueFormatTranslatorImpl
public interface ValueFormatTranslator
Helper for formatting characteristic values. The external format for UI Display is derived from the web-shops I18N
locale, which in turn depends on the browser's locale.
-
Method Summary
Modifier and TypeMethodDescriptionformat(CsticModel cstic, String value) Converts a characteristic value into an external format suitable for UI-Display.formatDate(Date date) Format date value from service to UIformatNumeric(String value) Formats numerical value from service to UIbooleanisNumericCsticType(CsticModel model) Checks the characteristic model whether it is either of type float or integerConverts a characteristic value into an internal format, which is used by the underlying API's.parseNumeric(String value) Parses numerical value from UI to service
-
Method Details
-
parse
Converts a characteristic value into an internal format, which is used by the underlying API's.- Parameters:
uiType- UI type the characteristic value belongs tovalue- characteristic value in external format- Returns:
- characteristic value in internal format
-
format
Converts a characteristic value into an external format suitable for UI-Display.- Parameters:
cstic- characteristic the value belongs tovalue- characteristic value in internal format- Returns:
- characteristic value in external format
-
isNumericCsticType
Checks the characteristic model whether it is either of type float or integer- Parameters:
model- characteristic to be checked- Returns:
- true if characteristic is numeric
-
parseNumeric
Parses numerical value from UI to service- Parameters:
value- value to be parsed- Returns:
- formatted numerical value
-
formatNumeric
Formats numerical value from service to UI- Parameters:
value- value to be parsed- Returns:
- formatted numerical value
-
formatDate
Format date value from service to UI- Parameters:
date- Date value which should be formatted- Returns:
- the formatted date value
-