Interface Prioritized

  • 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 Prioritized with lower priority number is more significant than a Prioritized with 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 IllegalArgumentException if such a priority is used (unless such a service documents the specific usage of a negative priority)

    A Prioritized with priority 1 is more significant (will be returned before) priority 2.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_PRIORITY
      Default priority for any prioritized component (whether it implements this interface or uses javax.annotation.Priority annotation.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int priority()
      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 uses javax.annotation.Priority annotation.
        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 the javax.annotation.Priority annotation rather then implementing this interface as long as it is supported by the library using this Prioritized.
        Returns:
        the priority of this service, must be a non-negative number