@SuppressWarnings({"rawtypes", "unchecked"})
        @Override
        public int compareTo(QualifiedValue<?> other) {
            if (orderIndex < other.orderIndex) {
                return -1;
            }
            if (orderIndex > other.orderIndex) {
                return 1;
            }
            if (value instanceof Comparable<?>) {
                return ((Comparable) value).compareTo(other);
            }
            return 0;
        }