共用方式為


ConfigurationSource Interface

public interface ConfigurationSource

Configuration property source which provides configuration values from a specific place. Samples may include properties file supported by frameworks or other source. Note that environment configuration (environment variables and system properties) are supported by default and don't need a source implementation.

Method Summary

Modifier and Type Method and Description
abstract Map<String,String> getProperties(String source)

Returns all properties (name and value) which names start with given path.

Method Details

getProperties

public abstract Map getProperties(String source)

Returns all properties (name and value) which names start with given path. Null (or empty) path indicate that all properties should be returned. Example:

With following configuration properties:

  • azure.sdk.foo = 1
  • azure.sdk.bar.baz = 2

ConfigurationSource implementation must the following behavior:

  • getProperties(null must return both properties
  • getProperties("azure.sdk") must return both properties
  • getProperties("azure.sdk.foo") must return {"azure.sdk.foo", "1"}
  • getProperties("azure.sdk.ba") must return empty map

Parameters:

source - property name prefix

Returns:

Map of properties under given path.

Applies to