class AAIFluentTypeReverseLookup {

    public AAIObjectType fromName(String name, String uri) {

        String className = CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_CAMEL, name);

        uri = uri.replaceFirst(".*?/v\\d+", "");
        try {
            Class<? extends GraphInventoryFluentType.Info> clazz =
                    (Class<? extends GraphInventoryFluentType.Info>) Class
                            .forName("org.onap.aaiclient.client.generated.fluentbuilders." + className + "$Info");

            GraphInventoryFluentType.Info type = clazz.getConstructor().newInstance();

            Optional<String> parentTemplate = findParentPath(type, uri);
            if (parentTemplate.isPresent()) {
                return new AAIObjectType(parentTemplate.get(), type.getPartialUri(), type.getName(), false);
            } else {
                // fallback to enum lookup
                return AAIObjectType.fromTypeName(name);
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException
                | InvocationTargetException | NoSuchMethodException | SecurityException e) {
        }
        return AAIObjectType.UNKNOWN;
    }

}