org.apache.commons.convert.conversion
Class StringToIntegerConversion
java.lang.Object
org.apache.commons.convert.conversion.AbstractConversion
org.apache.commons.convert.conversion.StringToIntegerConversion
- All Implemented Interfaces:
- Conversion
public class StringToIntegerConversion
- extends AbstractConversion
Conversion from String to Integer using Integer.valueOf()
.
- Since:
- 1.0
- Version:
- $Id: StringToIntegerConversion.java 155441 2005-02-26 13:19:22Z dirkv $
- Author:
- Stephen Colebourne, Oliver Heger
INSTANCE
public static final Conversion INSTANCE
- Singleton instance of this factory
StringToIntegerConversion
protected StringToIntegerConversion()
- Constructor.
convertValue
protected Object convertValue(Object value,
Converter converter)
- Convert the non-null String to an Integer using
Integer.valueOf()
.
- Overrides:
convertValue
in class AbstractConversion
- Parameters:
value
- the input value to be converted, pre-checked to not be nullconverter
- the converter being used, not null
- Returns:
- the converted value
- Throws:
RuntimeException
- if conversion fails
Copyright © 2003-2010 The Apache Software Foundation. All Rights Reserved.