Package net.sf.basedb.util.formatter
Class ItemTypeFormatter
- java.lang.Object
-
- net.sf.basedb.util.formatter.ItemTypeFormatter
-
-
Constructor Summary
Constructors Constructor Description ItemTypeFormatter()
Create a new formatter.ItemTypeFormatter(String nullValue)
Create a new formatter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
format(Integer value)
Format a value by converting it to a string.Integer
parseString(String value)
Parse a string and return a value of the correct type.
-
-
-
Field Detail
-
nullValue
private String nullValue
-
-
Constructor Detail
-
ItemTypeFormatter
public ItemTypeFormatter()
Create a new formatter. Null values are formatted as an empty string.
-
ItemTypeFormatter
public ItemTypeFormatter(String nullValue)
Create a new formatter.- Parameters:
nullValue
- The string to return if a null item is passed toformat(Integer)
-
-
Method Detail
-
format
public String format(Integer value)
Description copied from interface:Formatter
Format a value by converting it to a string.
-
parseString
public Integer parseString(String value)
Description copied from interface:Formatter
Parse a string and return a value of the correct type. A null input string should (unless otherwise documented by a specific formatter implementation) be allowed and may return null or any other "default" value.- Specified by:
parseString
in interfaceFormatter<Integer>
- Parameters:
value
- The string to parse- Returns:
- An object
-
-