-
- All Known Implementing Classes:
HoconMpMetaConfigProvider,YamlMetaConfigProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface Prioritized
Interface to define that this class is a class with priority. One of the uses is for services loaded by a ServiceLoader.A
Prioritizedwith lower priority number is more significant than aPrioritizedwith a higher priority number.For cases where priority is the same, implementation must define ordering of such
Prioritized.Negative priorities are not allowed and services using priorities should throw an
IllegalArgumentExceptionif such a priority is used (unless such a service documents the specific usage of a negative priority)A
Prioritizedwith priority1is more significant (will be returned before) priority2.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PRIORITYDefault priority for any prioritized component (whether it implements this interface or usesjavax.annotation.Priorityannotation.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intpriority()Priority of this class (maybe because it is defined dynamically, so it cannot be defined by an annotation).
-
-
-
Field Detail
-
DEFAULT_PRIORITY
static final int DEFAULT_PRIORITY
Default priority for any prioritized component (whether it implements this interface or usesjavax.annotation.Priorityannotation.- See Also:
- Constant Field Values
-
-
Method Detail
-
priority
int priority()
Priority of this class (maybe because it is defined dynamically, so it cannot be defined by an annotation). If not dynamic, you can use thejavax.annotation.Priorityannotation rather then implementing this interface as long as it is supported by the library using thisPrioritized.- Returns:
- the priority of this service, must be a non-negative number
-
-