|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.univocity.parsers.conversions.NullStringConversion
public class NullStringConversion
Converts Strings to null and vice versa
This class supports multiple representations of null values. For example, you can define conversions from different Strings such as "N/A, ?, -" to null.
The reverse conversion from a null to String (in revert(Object) will return the first String provided in this class constructor if the object is null.
Using the previous example, a call to revert(Object) will produce "N/A".
| Constructor Summary | |
|---|---|
NullStringConversion(String... nullRepresentations)
Creates conversions from Strings to null. |
|
| Method Summary | |
|---|---|
Object |
execute(Object input)
Converts an Object to null. |
Object |
revert(Object input)
Converts a null input to a String representation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NullStringConversion(String... nullRepresentations)
The list of Strings that identify nulls are mandatory.
nullRepresentations - Strings that identify a true value. The first element will be returned when executing revert(Object)| Method Detail |
|---|
public Object execute(Object input)
execute in interface Conversion<Object,Object>input - an Object to be converted to null.
public Object revert(Object input)
revert in interface Conversion<Object,Object>input - an Object that, if null, will be transformed to a String.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||