Interface Configuration

All Known Implementing Classes:
CommonConfiguration

public interface Configuration
This server needs some basic configuration to start running. The configuration file can be defined as an XML file. See an example in configuration.example.xml. You can also extend this file to create your own configuration values.
  • Method Details

    • load

      void load(String file) throws Exception
      Load the configuration by configured files.
      Parameters:
      file - the configuration file
      Throws:
      Exception - something went wrong on parsing the configuration file
    • getBoolean

      boolean getBoolean(ConfigurationType key)
      Retrieves the value by key.
      Parameters:
      key - the configuration's key
      Returns:
      the value in Boolean
    • getInt

      int getInt(ConfigurationType key)
      Retrieves the value by key.
      Parameters:
      key - the configuration's key
      Returns:
      the value in Integer
    • getFloat

      float getFloat(ConfigurationType key)
      Retrieves the value by key.
      Parameters:
      key - the configuration's key
      Returns:
      the value in Float
    • getString

      String getString(ConfigurationType key)
      Retrieves the value by key.
      Parameters:
      key - the configuration's key
      Returns:
      the value in String
    • get

      Retrieves the value by key.
      Parameters:
      key - the configuration's key
      Returns:
      the value in Object
    • isDefined

      boolean isDefined(ConfigurationType key)
      Determine if this configuration is existed or defined. If you want some configuration value to be treated as an "undefined" status, let its value "-1".
      Parameters:
      key - The desired configuration's key
      Returns:
      true if the configuration is defined, otherwise return false
    • toString

      String toString()
      Retrieves readable text.
      Overrides:
      toString in class Object
      Returns:
      configuration information as human-readable data
    • clear

      void clear()
      Remove all configurations.