Class LightningConfig<F extends de.leonhard.storage.internal.FlatFile>

java.lang.Object
me.hsgamer.hscore.config.simplixstorage.LightningConfig<F>
Type Parameters:
F - the flat file type
All Implemented Interfaces:
Config

public class LightningConfig<F extends de.leonhard.storage.internal.FlatFile> extends Object implements Config
The Config implementation for SimplixStorage
  • Constructor Details

    • LightningConfig

      public LightningConfig(F flatFile)
      Create a new config
      Parameters:
      flatFile - the flat file
  • Method Details

    • ofJson

      public static LightningConfig<de.leonhard.storage.Json> ofJson(File file)
      Create a new config from a Json file
      Parameters:
      file - the file
      Returns:
      the config
    • ofToml

      public static LightningConfig<de.leonhard.storage.Toml> ofToml(File file)
      Create a new config from a Toml file
      Parameters:
      file - the file
      Returns:
      the config
    • ofYaml

      public static LightningConfig<de.leonhard.storage.Yaml> ofYaml(File file)
      Create a new config from a Yaml file
      Parameters:
      file - the file
      Returns:
      the config
    • getOriginal

      public F getOriginal()
      Description copied from interface: Config
      Get the original instance
      Specified by:
      getOriginal in interface Config
      Returns:
      the original instance
    • get

      public Object get(Object def, String... path)
      Description copied from interface: Config
      Get the value from the path
      Specified by:
      get in interface Config
      Parameters:
      def - the default value if the value is not found
      path - the path
      Returns:
      the value
    • set

      public void set(Object value, String... path)
      Description copied from interface: Config
      Set the value to the path
      Specified by:
      set in interface Config
      Parameters:
      value - the value
      path - the path
    • contains

      public boolean contains(String... path)
      Description copied from interface: Config
      Check if the configuration contains the path
      Specified by:
      contains in interface Config
      Parameters:
      path - the path
      Returns:
      true if it does
    • getName

      public String getName()
      Description copied from interface: Config
      Get the name of the configuration
      Specified by:
      getName in interface Config
      Returns:
      the name
    • setIfAbsent

      public void setIfAbsent(Object value, String... path)
      Description copied from interface: Config
      Set the value to the path if it is not already set
      Specified by:
      setIfAbsent in interface Config
      Parameters:
      value - the value
      path - the path
    • getKeys

      public Set<String[]> getKeys(boolean deep, String... path)
      Description copied from interface: Config
      Get all keys from the path
      Specified by:
      getKeys in interface Config
      Parameters:
      deep - should we go deeper from the path?
      path - the path
      Returns:
      the keys
    • getValues

      public Map<String[],Object> getValues(boolean deep, String... path)
      Description copied from interface: Config
      Get all values from the path
      Specified by:
      getValues in interface Config
      Parameters:
      deep - should we go deeper from the path?
      path - the path
      Returns:
      the values
    • clear

      public void clear()
      Description copied from interface: Config
      Remove all paths from the configuration
      Specified by:
      clear in interface Config
    • setup

      public void setup()
      Description copied from interface: Config
      Set up the configuration
      Specified by:
      setup in interface Config
    • save

      public void save()
      Description copied from interface: Config
      Save the configuration
      Specified by:
      save in interface Config
    • reload

      public void reload()
      Description copied from interface: Config
      Reload the configuration
      Specified by:
      reload in interface Config
    • normalize

      public Object normalize(Object object)
      Description copied from interface: Config
      Normalize the library-specific object
      Specified by:
      normalize in interface Config
      Parameters:
      object - the object
      Returns:
      the normalized object
    • isNormalizable

      public boolean isNormalizable(Object object)
      Description copied from interface: Config
      Check if the object is normalizable
      Specified by:
      isNormalizable in interface Config
      Parameters:
      object - the object
      Returns:
      true if it is