Class BungeeScriptConfig

java.lang.Object
dev.magicmq.pyspigot.bungee.manager.config.BungeeScriptConfig
All Implemented Interfaces:
dev.magicmq.pyspigot.manager.config.ScriptConfig

public class BungeeScriptConfig extends Object implements dev.magicmq.pyspigot.manager.config.ScriptConfig
A class representing a script configuration file, for the BungeeCord implementation.
See Also:
  • Configuration
  • Constructor Details

    • BungeeScriptConfig

      public BungeeScriptConfig(File configFile, String defaults)
      Parameters:
      configFile - The configuration file
      defaults - A YAML-formatted string containing the desired default values for the configuration
  • Method Details

    • getConfigFile

      public File getConfigFile()
      Specified by:
      getConfigFile in interface dev.magicmq.pyspigot.manager.config.ScriptConfig
    • getConfigPath

      public Path getConfigPath()
      Specified by:
      getConfigPath in interface dev.magicmq.pyspigot.manager.config.ScriptConfig
    • load

      public void load() throws IOException
      Specified by:
      load in interface dev.magicmq.pyspigot.manager.config.ScriptConfig
      Throws:
      IOException
    • reload

      public void reload() throws IOException
      Specified by:
      reload in interface dev.magicmq.pyspigot.manager.config.ScriptConfig
      Throws:
      IOException
    • save

      public void save() throws IOException
      Specified by:
      save in interface dev.magicmq.pyspigot.manager.config.ScriptConfig
      Throws:
      IOException
    • setIfNotExists

      public boolean setIfNotExists(String path, Object value)
      Sets the specified path to the given value only if the path is not already set in the config file. Any specified default values are ignored when checking if the path is set.
      Specified by:
      setIfNotExists in interface dev.magicmq.pyspigot.manager.config.ScriptConfig
      Parameters:
      path - Path of the object to set
      value - Value to set the path to
      Returns:
      True if the path was set to the value (in other words the path was not previously set), false if the path was not set to the value (in other words the path was already previously set)
      See Also:
      • Configuration.set(String, Object)
    • getUnderlyingConfig

      public net.md_5.bungee.config.Configuration getUnderlyingConfig()
      Gets the underlying BungeeCord Configuration object.
      Returns:
      The underlying config object
    • get

      public <T> T get(String path, T def)
    • contains

      public boolean contains(String path)
    • get

      public Object get(String path)
    • getDefault

      public Object getDefault(String path)
    • set

      public void set(String path, Object value)
    • getSection

      public net.md_5.bungee.config.Configuration getSection(String path)
    • getKeys

      public Collection<String> getKeys()
    • getByte

      public byte getByte(String path)
    • getByte

      public byte getByte(String path, byte def)
    • getByteList

      public List<Byte> getByteList(String path)
    • getShort

      public short getShort(String path)
    • getShort

      public short getShort(String path, short def)
    • getShortList

      public List<Short> getShortList(String path)
    • getInt

      public int getInt(String path)
    • getInt

      public int getInt(String path, int def)
    • getIntList

      public List<Integer> getIntList(String path)
    • getLong

      public long getLong(String path)
    • getLong

      public long getLong(String path, long def)
    • getLongList

      public List<Long> getLongList(String path)
    • getFloat

      public float getFloat(String path)
    • getFloat

      public float getFloat(String path, float def)
    • getFloatList

      public List<Float> getFloatList(String path)
    • getDouble

      public double getDouble(String path)
    • getDouble

      public double getDouble(String path, double def)
    • getDoubleList

      public List<Double> getDoubleList(String path)
    • getBoolean

      public boolean getBoolean(String path)
    • getBoolean

      public boolean getBoolean(String path, boolean def)
    • getBooleanList

      public List<Boolean> getBooleanList(String path)
    • getChar

      public char getChar(String path)
    • getChar

      public char getChar(String path, char def)
    • getCharList

      public List<Character> getCharList(String path)
    • getString

      public String getString(String path)
    • getString

      public String getString(String path, String def)
    • getStringList

      public List<String> getStringList(String path)
    • getList

      public List<?> getList(String path)
    • getList

      public List<?> getList(String path, List<?> def)