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 Details

    • parse

      String parse(UiType uiType, String value)
      Converts a characteristic value into an internal format, which is used by the underlying API's.
      Parameters:
      uiType - UI type the characteristic value belongs to
      value - characteristic value in external format
      Returns:
      characteristic value in internal format
    • format

      String format(CsticModel cstic, String value)
      Converts a characteristic value into an external format suitable for UI-Display.
      Parameters:
      cstic - characteristic the value belongs to
      value - characteristic value in internal format
      Returns:
      characteristic value in external format
    • isNumericCsticType

      boolean isNumericCsticType(CsticModel model)
      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

      String parseNumeric(String value)
      Parses numerical value from UI to service
      Parameters:
      value - value to be parsed
      Returns:
      formatted numerical value
    • formatNumeric

      String formatNumeric(String value)
      Formats numerical value from service to UI
      Parameters:
      value - value to be parsed
      Returns:
      formatted numerical value
    • formatDate

      String formatDate(Date date)
      Format date value from service to UI
      Parameters:
      date - Date value which should be formatted
      Returns:
      the formatted date value