org.codegist.crest.serializer
Class ToStringSerializer<T>

java.lang.Object
  extended by org.codegist.crest.serializer.ToStringSerializer<T>
All Implemented Interfaces:
Serializer<T>

public class ToStringSerializer<T>
extends Object
implements Serializer<T>

Simple serializer that returns the toString() value of the given value or empty string if null.

Author:
Laurent Gilles (laurent.gilles@codegist.org)

Constructor Summary
ToStringSerializer()
           
 
Method Summary
 String serialize(T value)
          Simple serializer that returns the toString() value of the given value or empty string if null.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToStringSerializer

public ToStringSerializer()
Method Detail

serialize

public String serialize(T value)
Simple serializer that returns the toString() value of the given value or empty string if null.

Specified by:
serialize in interface Serializer<T>
Parameters:
value - Context of the serialization
Returns:
serialized value of param


Copyright © 2011. All Rights Reserved.