2.8.3: 2008-10-15

net.sf.basedb.util.formatter
Class ToStringFormatter

java.lang.Object
  extended by net.sf.basedb.util.formatter.ToStringFormatter
All Implemented Interfaces:
Formatter<Object>

public class ToStringFormatter
extends Object
implements Formatter<Object>

A generic formatter that simply formats objects by calling the toString() method. Null values are converted to the empty string.

Version:
2.0
Author:
nicklas
Last modified
$Date: 2008-09-05 17:16:27 +0200 (Fri, 05 Sep 2008) $

Constructor Summary
ToStringFormatter()
          Create a new integer formatter.
 
Method Summary
 String format(Object value)
          Format a value by converting it to a string.
 Number parseString(String value)
          Parse a string and return a value of the correct type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToStringFormatter

public ToStringFormatter()
Create a new integer formatter.

Method Detail

format

public String format(Object value)
Description copied from interface: Formatter
Format a value by converting it to a string.

Specified by:
format in interface Formatter<Object>
Parameters:
value - The value to format
Returns:
A formatted string

parseString

public Number parseString(String value)
Description copied from interface: Formatter
Parse a string and return a value of the correct type.

Specified by:
parseString in interface Formatter<Object>
Parameters:
value - The string to parse
Returns:
An object

2.8.3: 2008-10-15