edu.isi.nlp.ClassUtils Maven / Gradle / Ivy
The newest version!
package edu.isi.nlp;
import com.google.common.base.Function;
/** Utility methods for working with Class objects */
public final class ClassUtils {
private ClassUtils() {
throw new UnsupportedOperationException();
}
/** A Guava {@link Function} to convert classes to their names. Does not accept {@code null}. */
public static Function nameFunction() {
return ClassUtils.ClassNameFunction.INSTANCE;
}
private enum ClassNameFunction implements Function {
INSTANCE;
@Override
public String apply(final Class input) {
return input.getName();
}
}
/** A {@link Function} mapping objects to their {@link Class}. Does not accept {@code null}. */
public static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy