Interface ConfigurationService

    • Method Detail

      • getSettings

        Map<String,​Object> getSettings()
        Access to the complete map of config settings. The returned map is immutable
        Returns:
        The immutable map of config settings.
      • getSetting

        <T> @Nullable T getSetting​(String name,
                                   ConfigurationService.Converter<T> converter)
        Get the named setting, using the specified converter.
        Type Parameters:
        T - The Java type of the conversion
        Parameters:
        name - The name of the setting to get.
        converter - The converter to apply
        Returns:
        The converted (typed) setting. May return null (see getSetting(String, Class, Object))
      • getSetting

        <T> @PolyNull T getSetting​(String name,
                                   ConfigurationService.Converter<T> converter,
                                   @PolyNull T defaultValue)
        Get the named setting, using the specified converter and default value.
        Type Parameters:
        T - The Java type of the conversion
        Parameters:
        name - The name of the setting to get.
        converter - The converter to apply
        defaultValue - If no setting with that name is found, return this default value as the result.
        Returns:
        The converted (typed) setting. Will be the defaultValue if no such setting was defined.
      • getSetting

        <T> @PolyNull T getSetting​(String name,
                                   Class<T> expected,
                                   @PolyNull T defaultValue)
        Get the named setting. Differs from the form taking a Converter in that here we expect to have a simple cast rather than any involved conversion.
        Type Parameters:
        T - The Java type of the conversion
        Parameters:
        name - The name of the setting to get.
        expected - The expected Java type.
        defaultValue - If no setting with that name is found, return this default value as the result.
        Returns:
        The converted (typed) setting. Will be the defaultValue if no such setting was defined.