class AnnotationUtils {

    public static String annotatedName(Class<?> clazz) {
        if (AlgoOperator.class.isAssignableFrom(clazz)) {
            IoOpAnnotation annotation = clazz.getAnnotation(IoOpAnnotation.class);
            return annotation == null ? null : annotation.name();
        } else if (BaseDB.class.isAssignableFrom(clazz)) {
            DBAnnotation annotation = clazz.getAnnotation(DBAnnotation.class);
            return annotation == null ? null : annotation.name();
        } else if (BaseFileSystem.class.isAssignableFrom(clazz)) {
            FSAnnotation annotation = clazz.getAnnotation(FSAnnotation.class);
            return annotation == null ? null : annotation.name();
        } else {
            throw new IllegalStateException(
                    "Only DB and IO Operator class have annotated name: " + clazz.getCanonicalName());
        }
    }

}