class EntityStringer {

    public static Method fingerprint2Method(String fingerprint) throws BadSyntax {
        final var parts = fingerprint.split("\\|", -1);
        if (parts.length < 2) {
            throw new BadSyntax("Method fingerprint '" + fingerprint +
                    "' is badly formatted, does not have 'class|name' parts.");
        }
        try {
            final var klass = GeciReflectionTools.classForName(parts[0]);
            final var name = parts[1];
            if (parts.length > 2) {
                final var argClasses = Arrays.stream(parts).skip(2).map(EntityStringer::forName).toArray(Class[]::new);
                return GeciReflectionTools.getMethod(klass, name, argClasses);
            } else {
                return GeciReflectionTools.getMethod(klass, name);
            }
        } catch (ClassNotFoundException e) {
            throw new BadSyntax("Class in fingerprint '" + fingerprint + "' cannot be found.", e);
        } catch (NoSuchMethodException e) {
            throw new BadSyntax("Method in fingerprint '" + fingerprint + "' cannot be found.", e);
        }
    }

}