Interface SettingsSource

    • Method Detail

      • readSettings

        static <S extends SettingsSourceProperties readSettings​(ServiceLoader<S> loader)
        Convenience method for parsing properties from a SettingsSource. Note that this method requires an instantiated ServiceLoader instead of just the settings class, to support polymorphic SettingsSources in a JPMS environment. Otherwise, this module would have to declare a uses clause and only true SettingsSources could be read.
        Type Parameters:
        S - concrete SettingsSource type
        Parameters:
        loader - the service loader
        Returns:
        the filled properties after all loaded SettingsSources have been queried
      • loadSettings

        void loadSettings​(Properties props)
        Load the parsed settings into the given property object.
        Parameters:
        props - the object to write the settings to
      • getPriority

        default int getPriority()
        Returns the priority of this source. This is used to decide which source wins, if multiple sources write the same properties.
        Returns:
        the priority