Class ConfigurationSourceSystemProperty

java.lang.Object
com.helger.config.source.AbstractConfigurationSource
com.helger.config.source.sysprop.ConfigurationSourceSystemProperty
All Implemented Interfaces:
IConfigurationSource, IIterableConfigurationSource, IConfigurationValueProvider

@Immutable public class ConfigurationSourceSystemProperty extends AbstractConfigurationSource implements IIterableConfigurationSource
Default implementation of IConfigurationSource for system properties.
Author:
Philip Helger
  • Field Details

  • Constructor Details

    • ConfigurationSourceSystemProperty

      public ConfigurationSourceSystemProperty()
    • ConfigurationSourceSystemProperty

      public ConfigurationSourceSystemProperty(int nPriority)
  • Method Details

    • isInitializedAndUsable

      public boolean isInitializedAndUsable()
      Specified by:
      isInitializedAndUsable in interface IConfigurationSource
      Returns:
      true if the file was successfully initialized and can be used as a configuration source.
    • getConfigurationValue

      @Nullable public ConfiguredValue getConfigurationValue(@Nonnull @Nonempty String sKey)
      Description copied from interface: IConfigurationValueProvider
      Get the configuration value with the provided key.
      Specified by:
      getConfigurationValue in interface IConfigurationValueProvider
      Parameters:
      sKey - The key to be retrieved. May neither be null nor empty.
      Returns:
      null if no such value is available.
    • getAllConfigItems

      @Nonnull @ReturnsMutableCopy public com.helger.collection.commons.ICommonsMap<String,String> getAllConfigItems()
      Specified by:
      getAllConfigItems in interface IIterableConfigurationSource
      Returns:
      A map of all contained keys with their values in this configuration source. If the underlying source uses some kind of ordering (e.g. in files), this order should be maintained. Never null but maybe empty.