class ClassAliasIdResolver extends ClassNameIdResolver {

    public void addClassToId(final Class<?> clazz, final String id) {
        Assert.notNull(clazz, "Class cannot be null");
        Assert.hasText(id, "Alias (id) cannot be null or contain only whitespaces");

        if (classToId.containsKey(clazz)) {
            throw new IllegalArgumentException("Class " + clazz + " has already defined alias (id) " + classToId.get(clazz)
                    + " cannot set another alias " + id);
        }

        if (idToClass.containsKey(id)) {
            throw new IllegalArgumentException("Alias (id) " + id + " is used by another class " + idToClass.get(id)
                    + " and cannot be used by " + clazz);
        }

        classToId.put(clazz, id);
        idToClass.put(id, clazz);
    }

    public  ClassAliasIdResolver(final JavaType baseType, final TypeFactory typeFactory, final Map<String, Class<?>> idToClass,
            final Map<Class<?>, String> classToId);

}