
com.avides.xpath.utils.converters.ToCharacterConverter 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.Character Character}. If the found value is longer than 1
* character, the first character will be returned. If the value is
* null
or the found value is empty, null
will be
* returned.
*
* @author Martin Schumacher
* @since 1.0.0.RELEASE
*/
public class ToCharacterConverter implements Function
{
@Override
public Character apply(String t)
{
return (t != null) && (t.length() > 0) ? Character.valueOf(t.charAt(0)) : null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy