Package tigase.conf

## Class ConfigHolder

- java.lang.Object
- - tigase.conf.ConfigHolder

-     public class ConfigHolder
      extends java.lang.Object

  Created by andrzej on 18.09.2016.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static java.lang.String` | `PROPERTIES_CONFIG_FILE_DEF` |
    `static java.lang.String` | `PROPERTIES_CONFIG_FILE_KEY` |
    `static java.lang.String` | `TDSL_CONFIG_FILE_DEF` |
    `static java.lang.String` | `TDSL_CONFIG_FILE_KEY` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ConfigHolder()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static java.nio.file.Path` | `backupOldConfigFile​(java.nio.file.Path initPropsFile)` |
    `java.nio.file.Path` | `getConfigFilePath()` |
    `java.util.Map<java.lang.String,​java.lang.Object>` | `getProperties()` |
    `java.util.Optional<java.lang.String[]>` | `loadConfiguration​(java.lang.String[] args)` |
    `static void` | `main​(java.lang.String[] args)` |
    `static void` | `removeIfExistsAnd​(java.util.Map<java.lang.String,​java.lang.Object> props, java.lang.String oldKey, java.util.function.BiConsumer<java.util.function.BiConsumer<java.lang.String,​java.lang.Object>,​java.lang.Object> consumer)` |
    `static java.util.Optional` | `renameIfExists​(java.util.Map<java.lang.String,​java.lang.Object> props, java.lang.String oldKey, java.lang.String newKey, java.util.function.Function<java.lang.Object,​java.lang.Object> converter)` |
    `void` | `saveToDSLFile​(java.io.File f)` |
    `void` | `setProperties​(java.util.Map<java.lang.String,​java.lang.Object> props)` |
    `protected static boolean` | `upgradeDSL​(java.util.Map<java.lang.String,​java.lang.Object> props)` |

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

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

- - ### Field Detail

    - #### PROPERTIES_CONFIG_FILE_DEF

          public static final java.lang.String PROPERTIES_CONFIG_FILE_DEF

      See Also:
        Constant Field Values

    - #### PROPERTIES_CONFIG_FILE_KEY

          public static final java.lang.String PROPERTIES_CONFIG_FILE_KEY

      See Also:
        Constant Field Values

    - #### TDSL_CONFIG_FILE_DEF

          public static final java.lang.String TDSL_CONFIG_FILE_DEF

    - #### TDSL_CONFIG_FILE_KEY

          public static final java.lang.String TDSL_CONFIG_FILE_KEY

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ConfigHolder

          public ConfigHolder()

  - ### Method Detail

    - #### backupOldConfigFile

          public static java.nio.file.Path backupOldConfigFile​(java.nio.file.Path initPropsFile)
                                                        throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### main

          public static void main​(java.lang.String[] args)
                           throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### removeIfExistsAnd

          public static void removeIfExistsAnd​(java.util.Map<java.lang.String,​java.lang.Object> props,
                                               java.lang.String oldKey,
                                               java.util.function.BiConsumer<java.util.function.BiConsumer<java.lang.String,​java.lang.Object>,​java.lang.Object> consumer)

    - #### renameIfExists

          public static java.util.Optional renameIfExists​(java.util.Map<java.lang.String,​java.lang.Object> props,
                                                          java.lang.String oldKey,
                                                          java.lang.String newKey,
                                                          java.util.function.Function<java.lang.Object,​java.lang.Object> converter)

    - #### upgradeDSL

          protected static boolean upgradeDSL​(java.util.Map<java.lang.String,​java.lang.Object> props)

    - #### loadConfiguration

          public java.util.Optional<java.lang.String[]> loadConfiguration​(java.lang.String[] args)
                                                                   throws java.io.IOException,
                                                                          ConfigReader.ConfigException

      Throws:
        `java.io.IOException`
        `ConfigReader.ConfigException`

    - #### getProperties

          public java.util.Map<java.lang.String,​java.lang.Object> getProperties()

    - #### setProperties

          public void setProperties​(java.util.Map<java.lang.String,​java.lang.Object> props)

    - #### saveToDSLFile

          public void saveToDSLFile​(java.io.File f)
                             throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getConfigFilePath

          public java.nio.file.Path getConfigFilePath()