
com.avides.xpath.utils.converters.ToIntegerConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xpath-utils Show documentation
Show all versions of xpath-utils Show documentation
Provides some utility-methods to simplify the use of XPath
The newest version!
package com.avides.xpath.utils.converters;
import java.util.function.Function;
/**
* A converter ({@link java.util.function.Function Function}) that converts to a
* {@link java.lang.Integer Integer}. If the value is null
,
* null
is returned. If the value can not be converted to an
* {@link java.lang.Integer Integer}, a {@link java.lang.NumberFormatException}
* is thrown. Values are trimmed before conversion.
*
* @author Martin Schumacher
* @since 1.0.0.RELEASE
*/
public class ToIntegerConverter implements Function
{
@Override
public Integer apply(String t)
{
return t != null ? Integer.valueOf(t.trim()) : null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy