Search in sources :

Example 1 with Multi

use of org.opt4j.core.config.annotations.Multi in project opt4j by felixreimann.

the class PropertyModule method compareTo.

/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
@Override
public int compareTo(PropertyModule other) {
    Class<? extends Module> clazz1 = this.getModule().getClass();
    Class<? extends Module> clazz2 = other.getModule().getClass();
    String classname1 = clazz1.getName();
    String classname2 = clazz2.getName();
    if (!clazz1.equals(clazz2)) {
        return classname1.compareTo(classname2);
    } else {
        Multi multi = clazz1.getAnnotation(Multi.class);
        if (multi == null) {
            return 0;
        } else {
            return this.id - other.id;
        }
    }
}
Also used : Multi(org.opt4j.core.config.annotations.Multi)

Aggregations

Multi (org.opt4j.core.config.annotations.Multi)1