
net.sf.staccatocommons.util.apache.Chars Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of staccatissimo-util Show documentation
Show all versions of staccatissimo-util Show documentation
Staccatissimo Utility Classes
The newest version!
/**
* Copyright (c) 2010-2012, The StaccatoCommons Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
/////////////////////////////////////////////////
///// WARNING: GENERATE CODE. DO NOT EDIT ///////
/////////////////////////////////////////////////
package net.sf.staccatocommons.util.apache;
import net.sf.staccatocommons.defs.NullSafe;
import net.sf.staccatocommons.defs.function.Function;
import net.sf.staccatocommons.defs.predicate.Predicate;
import net.sf.staccatocommons.lang.function.internal.TopLevelFunction;
import net.sf.staccatocommons.lang.predicate.internal.TopLevelPredicate;
import org.apache.commons.lang.CharUtils;
/***
* {@link Function}s and {@link Predicate}s based on Apache {@link CharUtils}.
* They provide a 1-1 mapping to that utility class.
*/
public final class Chars {
/**
* @see CharUtils#toCharacterObject(String)
*/
@NullSafe
public static Function toCharacterObject() {
class ApacheToCharacterObjectFunction extends TopLevelFunction {
private static final long serialVersionUID = 1L;
public Character apply(String arg) {
return CharUtils.toCharacterObject(arg);
}
}
return new ApacheToCharacterObjectFunction();
}
/**
* @see CharUtils#toChar(String)
*/
@NullSafe
public static Function toChar() {
class ApacheToCharFunction extends TopLevelFunction {
private static final long serialVersionUID = 1L;
public Character apply(String arg) {
return CharUtils.toChar(arg);
}
}
return new ApacheToCharFunction();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy