org.apache.tamaya.functions

## Class ConfigurationFunctions

- java.lang.Object
- - org.apache.tamaya.functions.ConfigurationFunctions

-     public final class ConfigurationFunctions
      extends Object

  Accessor that provides useful functions along with configuration.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static org.apache.tamaya.ConfigOperator` | `addItems(Map<String,Object> items)` Creates an operator that adds items to the instance.
    `static org.apache.tamaya.ConfigOperator` | `addItems(Map<String,Object> items, boolean override)` Creates a ConfigOperator that adds the given items.
    `static org.apache.tamaya.Configuration` | `combine(String configName, org.apache.tamaya.Configuration... configs)` Creates a Configuration that creates a new instance using the configuration instances provided.
    `static org.apache.tamaya.Configuration` | `emptyConfiguration()` Accesses an empty `Configuration`.
    `static org.apache.tamaya.spi.ConfigurationContext` | `emptyConfigurationContext()` Accesses an empty `ConfigurationContext`.
    `static org.apache.tamaya.ConfigOperator` | `filter(PropertyMatcher filter)` Creates a ConfigOperator that creates a Configuration containing only keys that are selected by the given `PropertyMatcher`.
    `static org.apache.tamaya.ConfigQuery<String>` | `htmlInfo()` Creates a ConfigQuery that creates a html formatted ouitput of all properties in the given configuration.
    `static org.apache.tamaya.ConfigQuery<String>` | `htmlInfo(Map<String,String> info)` Creates a ConfigQuery that creates a html formatted ouitput of all properties in the given configuration.
    `static boolean` | `isKeyInSection(String key, String sectionKey)` Calculates the current section key and compares it with the given key.
    `static boolean` | `isKeyInSections(String key, String... sectionKeys)` Calculates the current section key and compares it with the given section keys.
    `static org.apache.tamaya.ConfigQuery<String>` | `jsonInfo()` Creates a ConfigQuery that creates a JSON formatted ouitput of all properties in the given configuration.
    `static org.apache.tamaya.ConfigQuery<String>` | `jsonInfo(Map<String,String> info)` Creates a ConfigQuery that creates a JSON formatted ouitput of all properties in the given configuration.
    `static org.apache.tamaya.ConfigOperator` | `map(KeyMapper keyMapper)` Creates a ConfigOperator that creates a Configuration with keys mapped as defined by the given keyMapper.
    `static org.apache.tamaya.spi.PropertySource` | `propertySourceFrom(String name, int ordinal, org.apache.tamaya.Configuration config)` Creates a `PropertySource`, based on the given `Configuration`.
    `static org.apache.tamaya.ConfigOperator` | `replaceItems(Map<String,Object> items)` Creates an operator that replaces the given items.
    `static org.apache.tamaya.ConfigOperator` | `section(String areaKey)` Creates a ConfigOperator that creates a Configuration containing only keys that are contained in the given section (non recursive).
    `static org.apache.tamaya.ConfigOperator` | `section(String areaKey, boolean stripKeys)` Creates a ConfigOperator that creates a Configuration containing only keys that are contained in the given section (non recursive).
    `static org.apache.tamaya.ConfigOperator` | `sectionRecursive(boolean stripKeys, String... sectionKeys)` Creates a ConfigOperator that creates a Configuration containing only keys that are contained in the given section (recursive).
    `static org.apache.tamaya.ConfigQuery<Set<String>>` | `sections()` Return a query to evaluate the set with all fully qualifies section names.
    `static org.apache.tamaya.ConfigQuery<Set<String>>` | `sections(Predicate<String> predicate)` Return a query to evaluate the set with all fully qualified section names, containing only the sections that match the predicate and have properties attached.
    `static org.apache.tamaya.ConfigOperator` | `sectionsRecursive(String... sectionKeys)` Creates a ConfigOperator that creates a Configuration containing only keys that are contained in the given section (recursive).
    `static org.apache.tamaya.ConfigQuery<String>` | `textInfo()` Creates a ConfigQuery that creates a plain text formatted output of all properties in the given configuration.
    `static org.apache.tamaya.ConfigQuery<String>` | `textInfo(Map<String,String> info)` Creates a ConfigQuery that creates a plain text formatted output of all properties in the given configuration.
    `static org.apache.tamaya.ConfigQuery<Set<String>>` | `transitiveSections()` Return a query to evaluate the set with all fully qualified section names, containing the transitive closure also including all subarea names, regardless if properties are accessible or not.
    `static org.apache.tamaya.ConfigQuery<Set<String>>` | `transitiveSections(Predicate<String> predicate)` Return a query to evaluate the set with all fully qualified section names, containing the transitive closure also including all subarea names, regardless if properties are accessible or not.
    `static org.apache.tamaya.ConfigQuery<String>` | `xmlInfo()` Creates a ConfigQuery that creates a XML formatted ouitput of all properties in the given configuration.
    `static org.apache.tamaya.ConfigQuery<String>` | `xmlInfo(Map<String,String> info)` Creates a ConfigQuery that creates a XML formatted ouitput of all properties in the given configuration.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### filter

          public static org.apache.tamaya.ConfigOperator filter(PropertyMatcher filter)

      Creates a ConfigOperator that creates a Configuration containing only keys that are selected by the given `PropertyMatcher`.
      Parameters:
        `filter` - the filter, not null
      Returns:
        the section configuration, with the areaKey stripped away.

    - #### map

          public static org.apache.tamaya.ConfigOperator map(KeyMapper keyMapper)

      Creates a ConfigOperator that creates a Configuration with keys mapped as defined by the given keyMapper.
      Parameters:
        `keyMapper` - the keyMapper, not null
      Returns:
        the section configuration, with the areaKey stripped away.

    - #### section

          public static org.apache.tamaya.ConfigOperator section(String areaKey)

      Creates a ConfigOperator that creates a Configuration containing only keys that are contained in the given section (non recursive). Hereby the section key is stripped away fromMap the resulting key.
      Parameters:
        `areaKey` - the section key, not null
      Returns:
        the section configuration, with the areaKey stripped away.

    - #### section

          public static org.apache.tamaya.ConfigOperator section(String areaKey,
                                                 boolean stripKeys)

      Creates a ConfigOperator that creates a Configuration containing only keys that are contained in the given section (non recursive).
      Parameters:
        `areaKey` - the section key, not null
        `stripKeys` - if set to true, the section key is stripped away fromMap the resulting key.
      Returns:
        the section configuration, with the areaKey stripped away.

    - #### isKeyInSection

          public static boolean isKeyInSection(String key,
                               String sectionKey)

      Calculates the current section key and compares it with the given key.
      Parameters:
        `key` - the fully qualified entry key, not null
        `sectionKey` - the section key, not null
      Returns:
        true, if the entry is exact in this section

    - #### isKeyInSections

          public static boolean isKeyInSections(String key,
                                String... sectionKeys)

      Calculates the current section key and compares it with the given section keys.
      Parameters:
        `key` - the fully qualified entry key, not null
        `sectionKeys` - the section keys, not null
      Returns:
        true, if the entry is exact in this section

    - #### sections

          public static org.apache.tamaya.ConfigQuery<Set<String>> sections()

      Return a query to evaluate the set with all fully qualifies section names. This method should return the sections as accurate as possible, but may not provide a complete set of sections that are finally accessible, especially when the underlying storage does not support key iteration.
      Returns:
        s set with all sections, never `null`.

    - #### transitiveSections

          public static org.apache.tamaya.ConfigQuery<Set<String>> transitiveSections()

      Return a query to evaluate the set with all fully qualified section names, containing the transitive closure also including all subarea names, regardless if properties are accessible or not. This method should return the sections as accurate as possible, but may not provide a complete set of sections that are finally accessible, especially when the underlying storage does not support key iteration.
      Returns:
        s set with all transitive sections, never `null`.

    - #### sections

          public static org.apache.tamaya.ConfigQuery<Set<String>> sections(Predicate<String> predicate)

      Return a query to evaluate the set with all fully qualified section names, containing only the sections that match the predicate and have properties attached. This method should return the sections as accurate as possible, but may not provide a complete set of sections that are finally accessible, especially when the underlying storage does not support key iteration.
      Parameters:
        `predicate` - A predicate to deternine, which sections should be returned, not `null`.
      Returns:
        s set with all sections, never `null`.

    - #### transitiveSections

          public static org.apache.tamaya.ConfigQuery<Set<String>> transitiveSections(Predicate<String> predicate)

      Return a query to evaluate the set with all fully qualified section names, containing the transitive closure also including all subarea names, regardless if properties are accessible or not. This method should return the sections as accurate as possible, but may not provide a complete set of sections that are finally accessible, especially when the underlying storage does not support key iteration.
      Parameters:
        `predicate` - A predicate to deternine, which sections should be returned, not `null`.
      Returns:
        s set with all transitive sections, never `null`.

    - #### sectionsRecursive

          public static org.apache.tamaya.ConfigOperator sectionsRecursive(String... sectionKeys)

      Creates a ConfigOperator that creates a Configuration containing only keys that are contained in the given section (recursive).
      Parameters:
        `sectionKeys` - the section keys, not null
      Returns:
        the section configuration, with the areaKey stripped away.

    - #### combine

          public static org.apache.tamaya.Configuration combine(String configName,
                                                org.apache.tamaya.Configuration... configs)

      Creates a Configuration that creates a new instance using the configuration instances provided. Hereby values from higher instances override previous values..
      Parameters:
        `configName` - the new config name
        `configs` - the configs to be combined. The entries of the first config are overwritten by entries of the later instances.
      Returns:
        the resulting configuration instance.

    - #### propertySourceFrom

          public static org.apache.tamaya.spi.PropertySource propertySourceFrom(String name,
                                                                int ordinal,
                                                                org.apache.tamaya.Configuration config)

      Creates a `PropertySource`, based on the given `Configuration`. The keys and propertx map are dynamically calculated, so the returned PropertySource is a real dynamic wrapper.
      Parameters:
        `name` - the name of the property source, not null.
        `ordinal` - ordinal of the property source.
        `config` - the config to be mapped, not null.
      Returns:
        a property source wrapping the configuration.

    - #### sectionRecursive

          public static org.apache.tamaya.ConfigOperator sectionRecursive(boolean stripKeys,
                                                          String... sectionKeys)

      Creates a ConfigOperator that creates a Configuration containing only keys that are contained in the given section (recursive).
      Parameters:
        `sectionKeys` - the section keys, not null
        `stripKeys` - if set to true, the section key is stripped away fromMap the resulting key.
      Returns:
        the section configuration, with the areaKey stripped away.

    - #### jsonInfo

          public static org.apache.tamaya.ConfigQuery<String> jsonInfo()

      Creates a ConfigQuery that creates a JSON formatted ouitput of all properties in the given configuration.
      Returns:
        the given query.

    - #### jsonInfo

          public static org.apache.tamaya.ConfigQuery<String> jsonInfo(Map<String,String> info)

      Creates a ConfigQuery that creates a JSON formatted ouitput of all properties in the given configuration.
      Parameters:
        `info` - the additional information attributes to be added to the output, e.g. the original request parameters.
      Returns:
        the given query.

    - #### xmlInfo

          public static org.apache.tamaya.ConfigQuery<String> xmlInfo()

      Creates a ConfigQuery that creates a XML formatted ouitput of all properties in the given configuration.
      Returns:
        the given query.

    - #### xmlInfo

          public static org.apache.tamaya.ConfigQuery<String> xmlInfo(Map<String,String> info)

      Creates a ConfigQuery that creates a XML formatted ouitput of all properties in the given configuration.
      Parameters:
        `info` - the additional information attributes to be added to the output, e.g. the original request parameters.
      Returns:
        the given query.

    - #### textInfo

          public static org.apache.tamaya.ConfigQuery<String> textInfo()

      Creates a ConfigQuery that creates a plain text formatted output of all properties in the given configuration.
      Returns:
        the given query.

    - #### textInfo

          public static org.apache.tamaya.ConfigQuery<String> textInfo(Map<String,String> info)

      Creates a ConfigQuery that creates a plain text formatted output of all properties in the given configuration.
      Parameters:
        `info` - configuration values to use for filtering.
      Returns:
        the given query.

    - #### addItems

          public static org.apache.tamaya.ConfigOperator addItems(Map<String,Object> items,
                                                  boolean override)

      Creates a ConfigOperator that adds the given items.
      Parameters:
        `items` - the items to be added/replaced.
        `override` - if true, all items existing are overridden by the new ones passed.
      Returns:
        the ConfigOperator, never null.

    - #### addItems

          public static org.apache.tamaya.ConfigOperator addItems(Map<String,Object> items)

      Creates an operator that adds items to the instance.
      Parameters:
        `items` - the items, not null.
      Returns:
        the operator, never null.

    - #### replaceItems

          public static org.apache.tamaya.ConfigOperator replaceItems(Map<String,Object> items)

      Creates an operator that replaces the given items.
      Parameters:
        `items` - the items.
      Returns:
        the operator for replacing the items.

    - #### htmlInfo

          public static org.apache.tamaya.ConfigQuery<String> htmlInfo()

      Creates a ConfigQuery that creates a html formatted ouitput of all properties in the given configuration.
      Returns:
        the given query.

    - #### htmlInfo

          public static org.apache.tamaya.ConfigQuery<String> htmlInfo(Map<String,String> info)

      Creates a ConfigQuery that creates a html formatted ouitput of all properties in the given configuration.
      Parameters:
        `info` - configuration values to use for filtering.
      Returns:
        the given query.

    - #### emptyConfiguration

          public static org.apache.tamaya.Configuration emptyConfiguration()

      Accesses an empty `Configuration`.
      Returns:
        an empty `Configuration`, never null.

    - #### emptyConfigurationContext

          public static org.apache.tamaya.spi.ConfigurationContext emptyConfigurationContext()

      Accesses an empty `ConfigurationContext`.
      Returns:
        an empty `ConfigurationContext`, never null.

Copyright © 2014–2016 Apache Software Foundation. All rights reserved.