
commons.box.app.Priority Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-box-app Show documentation
Show all versions of commons-box-app Show documentation
Common utils for BOX projects.
The newest version!
package commons.box.app;
import commons.box.util.Orders;
/**
* 优先级 根据 priority() 方法返回所定义对象的优先级 值越小优先级越高
* 创建作者:xingxiuyi
* 版权所属:xingxiuyi
*/
public interface Priority extends Comparable {
public static final int DEFAULT_PRIORITY = Integer.MAX_VALUE;
/**
* 获取优先级 值越小优先级越高
*
* 一般系统内置默认服务为 Short.MAX_VALUE
*
* @return
*/
public int priority();
@Override
default int compareTo(Priority o) {
if (o == null) return 1;
return Orders.compare(this.priority(), o.priority());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy