类 ConfigurationServiceImpl

    • 构造器详细资料

      • ConfigurationServiceImpl

        public ConfigurationServiceImpl​(Map settings)
        Constructs a ConfigurationServiceImpl
        参数:
        settings - The map of settings
    • 方法详细资料

      • getSettings

        public Map getSettings()
        从接口复制的说明: ConfigurationService
        Access to the complete map of config settings. The returned map is immutable
        指定者:
        getSettings 在接口中 ConfigurationService
        返回:
        The immutable map of config settings.
      • getSetting

        public <T> T getSetting​(String name,
                                ConfigurationService.Converter<T> converter,
                                T defaultValue)
        从接口复制的说明: ConfigurationService
        Get the named setting, using the specified converter and default value.
        指定者:
        getSetting 在接口中 ConfigurationService
        类型参数:
        T - The Java type of the conversion
        参数:
        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.
        返回:
        The converted (typed) setting. Will be the defaultValue if no such setting was defined.
      • getSetting

        public <T> T getSetting​(String name,
                                Class<T> expected,
                                T defaultValue)
        从接口复制的说明: ConfigurationService
        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.
        指定者:
        getSetting 在接口中 ConfigurationService
        类型参数:
        T - The Java type of the conversion
        参数:
        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.
        返回:
        The converted (typed) setting. Will be the defaultValue if no such setting was defined.
      • cast

        public <T> T cast​(Class<T> expected,
                          Object candidate)
        从接口复制的说明: ConfigurationService
        Cast candidate to the instance of expected type.
        指定者:
        cast 在接口中 ConfigurationService
        类型参数:
        T - The java type of the expected return
        参数:
        expected - The type of instance expected to return.
        candidate - The candidate object to be casted.
        返回:
        The instance of expected type or null if this cast fail.