com.univocity.parsers.conversions
Class IntegerConversion
java.lang.Object
com.univocity.parsers.conversions.ObjectConversion<Integer>
com.univocity.parsers.conversions.IntegerConversion
- All Implemented Interfaces:
- Conversion<String,Integer>
public class IntegerConversion
- extends ObjectConversion<Integer>
Converts Strings to Integers and vice versa
- Author:
- uniVocity Software Pty Ltd - [email protected]
Constructor Summary |
IntegerConversion()
Creates a Conversion from String to Integer with default values to return when the input is null. |
IntegerConversion(Integer valueIfStringIsNull,
String valueIfObjectIsNull)
Creates a Conversion from String to Integer with default values to return when the input is null. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IntegerConversion
public IntegerConversion()
- Creates a Conversion from String to Integer with default values to return when the input is null.
This default constructor assumes the output of a conversion should be null when input is null
IntegerConversion
public IntegerConversion(Integer valueIfStringIsNull,
String valueIfObjectIsNull)
- Creates a Conversion from String to Integer with default values to return when the input is null.
- Parameters:
valueIfStringIsNull
- default Integer value to be returned when the input String is null. Used when ObjectConversion.execute(String)
is invoked.valueIfObjectIsNull
- default String value to be returned when a Integer input is null. Used when revert(Integer)
is invoked.
fromString
protected Integer fromString(String input)
- Converts a String to Integer.
- Specified by:
fromString
in class ObjectConversion<Integer>
- Parameters:
input
- The String to be converted to T
- Returns:
- an instance of T, converted from the String input.
Copyright © 2014 uniVocity Software Pty Ltd. All rights reserved.