com.github.zhangchengji.build.Ordered Maven / Gradle / Ivy
Show all versions of flying-client Show documentation
package com.github.zhangchengji.build;
/**
* {@code Ordered} is an interface that can be implemented by objects that
* should be orderable, for example in a {@code Collection}.
*
* The actual {@link #getOrder() order} can be interpreted as prioritization,
* with the first object (with the lowest order value) having the highest
* priority.
*
* @since 1.0.0
*/
public interface Ordered {
/**
* Useful constant for the highest precedence value.
* @see Integer#MIN_VALUE
*/
int HIGHEST_PRECEDENCE = Integer.MIN_VALUE;
/**
* Useful constant for the lowest precedence value.
* @see Integer#MAX_VALUE
*/
int LOWEST_PRECEDENCE = Integer.MAX_VALUE;
/**
* Get the order value of this object.
*
Higher values are interpreted as lower priority. As a consequence,
* the object with the lowest value has the highest priority (somewhat
* analogous to Servlet {@code load-on-startup} values).
*
Same order values will result in arbitrary sort positions for the
* affected objects.
* @return the order value
* @see #HIGHEST_PRECEDENCE
* @see #LOWEST_PRECEDENCE
*/
int getOrder();
}