net.intelie.pipes.util.Classes Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pipes-api Show documentation
Show all versions of pipes-api Show documentation
Intelie Pipes' API classes and interfaces
package net.intelie.pipes.util;
import net.intelie.pipes.Expression;
import java.util.List;
public abstract class Classes {
public static String toStringClassOf(Object parameter) {
if (parameter == null)
return "";
return toStringClass(parameter.getClass()) +
(parameter instanceof Expression ? "[" + ((Expression) parameter).type().displayName() + "]" : "");
}
public static String toStringClass(Class type) {
String result = type.getSimpleName();
while (type.getEnclosingClass() != null) {
type = type.getEnclosingClass();
result = type.getSimpleName() + "." + result;
}
return result;
}
}