All Downloads are FREE. Search and download functionalities are using the official Maven repository.

name.remal.Ordered Maven / Gradle / Ivy

package name.remal;

import javax.annotation.Nonnull;

public interface Ordered> extends Comparable {

    default int getOrder() {
        return 0;
    }

    @Override
    @SuppressWarnings("deprecation")
    default int compareTo(@Nonnull T other) {
        int result = Integer.compare(getSuperOrder(), other.getSuperOrder());
        if (0 == result) result = Integer.compare(getOrder(), other.getOrder());
        return result;
    }

    /**
     * @deprecated This method shouldn't be overridden in implementation classes
     */
    @Deprecated
    @SuppressWarnings("DeprecatedIsStillUsed")
    default int getSuperOrder() {
        return 0;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy