io.helidon.config.Config.builder()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中io.helidon.config.Config.builder()方法的一些代码示例,展示了Config.builder()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.builder()方法的具体详情如下:
包路径:io.helidon.config.Config
类名称:Config
方法名:builder

Config.builder介绍

[英]Provides a Builder for creating a Config instance.
[中]提供用于创建配置实例的生成器。

代码示例

代码示例来源:origin: oracle/helidon

/**
 * Creates a new {@link Config} loaded from environment variables, system
 * properties, and the specified {@link ConfigSource}s.
 * <p>
 * The resulting configuration uses the following sources, in order:
 * <ol>
 * <li>{@link ConfigSources#environmentVariables() environment variables config source}<br>
 * Can disabled by {@link Builder#disableEnvironmentVariablesSource()}</li>
 * <li>{@link ConfigSources#systemProperties() system properties config source}
 * Can disabled by {@link Builder#disableSystemPropertiesSource()}</li>
 * <li>Source(s) specified by user in the method.</li>
 * </ol>
 * See <a href="multipleSources">multiple sources</a> for more information.
 *
 * @param configSources ordered list of configuration sources
 * @return new instance of {@link Config}
 * @see #loadSourcesFrom(Supplier[])
 * @see #builder(Supplier[])
 * @see #builderLoadSourcesFrom(Supplier[])
 * @see Builder#sources(List)
 * @see Builder#disableEnvironmentVariablesSource()
 * @see Builder#disableSystemPropertiesSource()
 * @see ConfigSources#create(Supplier[])
 * @see ConfigSources.CompositeBuilder
 * @see ConfigSources.MergingStrategy
 */
@SafeVarargs
static Config create(Supplier<ConfigSource>... configSources) {
  return builder(configSources).build();
}

代码示例来源:origin: oracle/helidon

return builder().build();

代码示例来源:origin: oracle/helidon

return builder().sources(CollectionsHelper.listOf(configSources));

代码示例来源:origin: oracle/helidon

/**
 * Provides a {@link Builder} for creating a {@link Config} based on the
 * specified {@link ConfigSource}s representing meta-configurations.
 * <p>
 * Each meta-configuration source should set the {@code sources} property to
 * be an array of config sources. See {@link ConfigSource#create(Config)} for
 * more information about the format of meta-configuration.
 *
 * @param metaSources ordered list of meta sources
 * @return new initialized Builder instance
 * @see #builder()
 * @see #builder(Supplier[])
 * @see ConfigSources#load(Supplier[])
 * @see #loadSourcesFrom(Supplier[])
 */
@SafeVarargs
static Builder builderLoadSourcesFrom(Supplier<ConfigSource>... metaSources) {
  return builder(ConfigSources.load(metaSources))
      .disableSystemPropertiesSource()
      .disableEnvironmentVariablesSource();
}

代码示例来源:origin: oracle/helidon

Config config = Config.builder()
    .sources(configSources)
    .build();

代码示例来源:origin: oracle/helidon

return load(Config.builder(metaSources)
          .disableEnvironmentVariablesSource()
          .disableSystemPropertiesSource()

代码示例来源:origin: oracle/helidon

/**
 * Get an instance of Helidon config (a tree structure) rather than the microprofile config.
 *
 * @return config instance that has the same properties as this instance
 */
public Config helidonConfig() {
  // I need to create a config based on this config instance
  return Config.builder()
      .disableSystemPropertiesSource()
      .disableEnvironmentVariablesSource()
      .sources(ConfigSources.create(asMap()))
      .build();
}

代码示例来源:origin: oracle/helidon

Config c = Config.builder()
    .disableSystemPropertiesSource()
    .disableFilterServices()

代码示例来源:origin: org.microbean/microbean-helidon-webserver-cdi

private static final Config.Builder createConfigBuilder(final BeanManager beanManager,
                            final Annotation... qualifiers)
{
 Objects.requireNonNull(beanManager);
 Objects.requireNonNull(qualifiers);
 final Config.Builder returnValue = Config.builder();
 assert returnValue != null;
 // Permit arbitrary customization.
 beanManager.getEvent().select(Config.Builder.class, qualifiers).fire(returnValue);
 return returnValue;
}

代码示例来源:origin: io.helidon.config/helidon-config

/**
 * Creates a new {@link Config} loaded from environment variables, system
 * properties, and the specified {@link ConfigSource}s.
 * <p>
 * The resulting configuration uses the following sources, in order:
 * <ol>
 * <li>{@link ConfigSources#environmentVariables() environment variables config source}<br>
 * Can disabled by {@link Builder#disableEnvironmentVariablesSource()}</li>
 * <li>{@link ConfigSources#systemProperties() system properties config source}
 * Can disabled by {@link Builder#disableSystemPropertiesSource()}</li>
 * <li>Source(s) specified by user in the method.</li>
 * </ol>
 * See <a href="multipleSources">multiple sources</a> for more information.
 *
 * @param configSources ordered list of configuration sources
 * @return new instance of {@link Config}
 * @see #loadSourcesFrom(Supplier[])
 * @see #builder(Supplier[])
 * @see #builderLoadSourcesFrom(Supplier[])
 * @see Builder#sources(List)
 * @see Builder#disableEnvironmentVariablesSource()
 * @see Builder#disableSystemPropertiesSource()
 * @see ConfigSources#create(Supplier[])
 * @see ConfigSources.CompositeBuilder
 * @see ConfigSources.MergingStrategy
 */
@SafeVarargs
static Config create(Supplier<ConfigSource>... configSources) {
  return builder(configSources).build();
}

代码示例来源:origin: io.helidon.config/helidon-config

return builder().build();

代码示例来源:origin: io.helidon.config/helidon-config

return builder().sources(CollectionsHelper.listOf(configSources));

代码示例来源:origin: io.helidon.config/helidon-config

/**
 * Provides a {@link Builder} for creating a {@link Config} based on the
 * specified {@link ConfigSource}s representing meta-configurations.
 * <p>
 * Each meta-configuration source should set the {@code sources} property to
 * be an array of config sources. See {@link ConfigSource#create(Config)} for
 * more information about the format of meta-configuration.
 *
 * @param metaSources ordered list of meta sources
 * @return new initialized Builder instance
 * @see #builder()
 * @see #builder(Supplier[])
 * @see ConfigSources#load(Supplier[])
 * @see #loadSourcesFrom(Supplier[])
 */
@SafeVarargs
static Builder builderLoadSourcesFrom(Supplier<ConfigSource>... metaSources) {
  return builder(ConfigSources.load(metaSources))
      .disableSystemPropertiesSource()
      .disableEnvironmentVariablesSource();
}

代码示例来源:origin: io.helidon.config/helidon-config

return load(Config.builder(metaSources)
          .disableEnvironmentVariablesSource()
          .disableSystemPropertiesSource()

代码示例来源:origin: io.helidon.microprofile.config/helidon-microprofile-config

/**
 * Get an instance of Helidon config (a tree structure) rather than the microprofile config.
 *
 * @return config instance that has the same properties as this instance
 */
public Config helidonConfig() {
  // I need to create a config based on this config instance
  return Config.builder()
      .disableSystemPropertiesSource()
      .disableEnvironmentVariablesSource()
      .sources(ConfigSources.create(asMap()))
      .build();
}

代码示例来源:origin: io.helidon.microprofile.config/helidon-microprofile-config

Config c = Config.builder()
    .disableSystemPropertiesSource()
    .disableFilterServices()

相关文章