
name.remal.Ordered Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common Show documentation
Show all versions of common Show documentation
Java & Kotlin tools: common
The newest version!
package name.remal;
import org.jetbrains.annotations.NotNull;
public interface Ordered> extends Comparable {
default int getOrder() {
return 0;
}
@Override
@SuppressWarnings("deprecation")
default int compareTo(@NotNull 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