Class StringToLongConverter

java.lang.Object
com.oorian.data.converter.StringToLongConverter
All Implemented Interfaces:
Converter<String,Long>

public class StringToLongConverter extends Object implements Converter<String,Long>
Converts between String and Long.
Since:
2.1
Version:
1.0
Author:
Marvin P. Warble Jr.
  • Constructor Details

    • StringToLongConverter

      public StringToLongConverter()
      Creates a new converter with the default error message.
    • StringToLongConverter

      public StringToLongConverter(String errorMessage)
      Creates a new converter with a custom error message.
      Parameters:
      errorMessage - the error message shown when conversion fails
  • Method Details

    • convertToModel

      public Long convertToModel(String value) throws ConversionException
      Description copied from interface: Converter
      Converts a presentation value to its model representation.
      Specified by:
      convertToModel in interface Converter<String,Long>
      Parameters:
      value - the presentation value to convert (may be null)
      Returns:
      the model value
      Throws:
      ConversionException - if conversion fails
    • convertToPresentation

      public String convertToPresentation(Long value)
      Description copied from interface: Converter
      Converts a model value to its presentation representation.
      Specified by:
      convertToPresentation in interface Converter<String,Long>
      Parameters:
      value - the model value to convert (may be null)
      Returns:
      the presentation value