All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.intelie.pipes.util.Classes Maven / Gradle / Ivy

There is a newer version: 0.25.5
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy