2.17.2: 2011-06-17

net.sf.basedb.util.formatter
Class ToStringFormatter<T>

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

public class ToStringFormatter<T>
extends Object
implements Formatter<T>

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-25 09:01:30 +0200 (Thu, 25 Sep 2008) $

Constructor Summary
ToStringFormatter()
          Create a new integer formatter.
 
Method Summary
 String format(T value)
          Format a value by converting it to a string.
 T 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(T value)
Description copied from interface: Formatter
Format a value by converting it to a string.

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

parseString

public T 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 interface Formatter<T>
Parameters:
value - The string to parse
Returns:
An object

2.17.2: 2011-06-17