com.univocity.parsers.conversions
Class ToStringConversion

java.lang.Object
  extended by com.univocity.parsers.conversions.ToStringConversion
All Implemented Interfaces:
Conversion<Object,Object>

public class ToStringConversion
extends Object
implements Conversion<Object,Object>

Converts any non-null object to its String representation.


Constructor Summary
ToStringConversion()
           
 
Method Summary
 Object execute(Object input)
          Converts a value of type I to a value of type O.
 Object revert(Object input)
          Converts a value of type O to a value of type I.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToStringConversion

public ToStringConversion()
Method Detail

execute

public Object execute(Object input)
Description copied from interface: Conversion
Converts a value of type I to a value of type O. When used in conjunction with the Convert annotation, this method will perform the conversion from a parsed input String (if no other conversion has been applied before) to a value of the desired type, and the result will be assigned to the annotated field. Note that conversions can be chained so you need to make sure the input type of any previous conversion is compatible with I

Specified by:
execute in interface Conversion<Object,Object>
Parameters:
input - the input of type I to be converted to an object of type O
Returns:
the conversion result.

revert

public Object revert(Object input)
Description copied from interface: Conversion
Converts a value of type O to a value of type I. When used in conjunction with the Convert annotation, this method will convert the value of the annotated field so it can be written to the output (usually a String). Note that conversions can be chained so you need to make sure the type of any previous conversion is compatible with O

Specified by:
revert in interface Conversion<Object,Object>
Parameters:
input - the input of type O to be converted to an object of type I
Returns:
the conversion result.


Copyright © 2016 uniVocity Software Pty Ltd. All rights reserved.