Class AbstractDBConfig

  • All Implemented Interfaces:
    DBConfig
    Direct Known Subclasses:
    DefaultDBConfig

    public class AbstractDBConfig
    extends java.lang.Object
    implements DBConfig
    An abstract implementation of DBConfig.
    Author:
    Tobias Downer
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractDBConfig​(java.io.File current_path)
      Constructs the DBConfig.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.File currentPath()
      Returns the current path set for this configuration.
      protected java.lang.String getDefaultValue​(java.lang.String property_key)
      Returns the default value for the configuration property with the given key.
      java.lang.String getValue​(java.lang.String property_key)
      Returns the value that was set for the configuration property with the given name.
      DBConfig immutableCopy()
      Makes an immutable copy of this configuration.
      protected void setValue​(java.lang.String property_key, java.lang.String val)
      Sets the configuration value for the key property key.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractDBConfig

        public AbstractDBConfig​(java.io.File current_path)
        Constructs the DBConfig.
    • Method Detail

      • getDefaultValue

        protected java.lang.String getDefaultValue​(java.lang.String property_key)
        Returns the default value for the configuration property with the given key.
      • setValue

        protected void setValue​(java.lang.String property_key,
                                java.lang.String val)
        Sets the configuration value for the key property key.
      • currentPath

        public java.io.File currentPath()
        Description copied from interface: DBConfig
        Returns the current path set for this configuration. This is useful if the configuration is based on a configuration file that has path references relative to the configuration file. In this case, the path returned here would be the path to the configuration file.
        Specified by:
        currentPath in interface DBConfig
      • getValue

        public java.lang.String getValue​(java.lang.String property_key)
        Description copied from interface: DBConfig
        Returns the value that was set for the configuration property with the given name.

        This method must always returns a value that the database engine can use provided the 'property_key' is a supported key. If the property key is not supported and the key was not set, null is returned.

        Specified by:
        getValue in interface DBConfig
      • immutableCopy

        public DBConfig immutableCopy()
        Description copied from interface: DBConfig
        Makes an immutable copy of this configuration.
        Specified by:
        immutableCopy in interface DBConfig