Class Config

java.lang.Object
org.cloudburstmc.server.utils.Config
Direct Known Subclasses:
PluginConfig

public class Config extends Object
author: MagicDroidX Nukkit
  • Field Details

  • Constructor Details

    • Config

      public Config(int type)
      Constructor for Config instance with undefined file object
      Parameters:
      type - - Config type
    • Config

      public Config()
      Constructor for Config (YAML) instance with undefined file object
    • Config

      public Config(String file)
    • Config

      public Config(File file)
    • Config

      public Config(String file, int type)
    • Config

      public Config(File file, int type)
    • Config

      @Deprecated public Config(String file, int type, LinkedHashMap<String,​Object> defaultMap)
      Deprecated.
    • Config

      public Config(String file, int type, ConfigSection defaultMap)
    • Config

      public Config(File file, int type, ConfigSection defaultMap)
    • Config

      @Deprecated public Config(File file, int type, LinkedHashMap<String,​Object> defaultMap)
      Deprecated.
  • Method Details

    • reload

      public void reload()
    • load

      public boolean load(String file)
    • load

      public boolean load(String file, int type)
    • load

      public boolean load(String file, int type, ConfigSection defaultMap)
    • load

      public boolean load(InputStream inputStream)
    • check

      public boolean check()
    • isCorrect

      public boolean isCorrect()
    • save

      public boolean save(File file, boolean async)
      Save configuration into provided file. Internal file object will be set to new file.
      Parameters:
      file -
      async -
      Returns:
    • save

      public boolean save(File file)
    • save

      public boolean save()
    • save

      public boolean save(Boolean async)
    • set

      public void set(String key, Object value)
    • get

      public Object get(String key)
    • get

      public <T> T get(String key, T defaultValue)
    • getSection

      public ConfigSection getSection(String key)
    • isSection

      public boolean isSection(String key)
    • getSections

      public ConfigSection getSections(String key)
    • getSections

      public ConfigSection getSections()
    • getInt

      public int getInt(String key)
    • getInt

      public int getInt(String key, int defaultValue)
    • isInt

      public boolean isInt(String key)
    • getLong

      public long getLong(String key)
    • getLong

      public long getLong(String key, long defaultValue)
    • isLong

      public boolean isLong(String key)
    • getDouble

      public double getDouble(String key)
    • getDouble

      public double getDouble(String key, double defaultValue)
    • isDouble

      public boolean isDouble(String key)
    • getString

      public String getString(String key)
    • getString

      public String getString(String key, String defaultValue)
    • isString

      public boolean isString(String key)
    • getBoolean

      public boolean getBoolean(String key)
    • getBoolean

      public boolean getBoolean(String key, boolean defaultValue)
    • isBoolean

      public boolean isBoolean(String key)
    • getList

      public <T> List<T> getList(String key)
    • getList

      public <T> List<T> getList(String key, List<T> defaultList)
    • isList

      public boolean isList(String key)
    • getStringList

      public List<String> getStringList(String key)
    • getIntegerList

      public List<Integer> getIntegerList(String key)
    • getBooleanList

      public List<Boolean> getBooleanList(String key)
    • getDoubleList

      public List<Double> getDoubleList(String key)
    • getFloatList

      public List<Float> getFloatList(String key)
    • getLongList

      public List<Long> getLongList(String key)
    • getByteList

      public List<Byte> getByteList(String key)
    • getCharacterList

      public List<Character> getCharacterList(String key)
    • getShortList

      public List<Short> getShortList(String key)
    • getMapList

      public List<Map> getMapList(String key)
    • setAll

      public void setAll(LinkedHashMap<String,​Object> map)
    • setAll

      public void setAll(ConfigSection section)
    • exists

      public boolean exists(String key)
    • exists

      public boolean exists(String key, boolean ignoreCase)
    • remove

      public void remove(String key)
    • getAll

      public Map<String,​Object> getAll()
    • getRootSection

      public ConfigSection getRootSection()
      Get root (main) config section of the Config
      Returns:
    • setDefault

      public int setDefault(LinkedHashMap<String,​Object> map)
    • setDefault

      public int setDefault(ConfigSection map)
    • getNested

      @Deprecated public Object getNested(String key)
      Deprecated.
      use get(String) instead
    • getNested

      @Deprecated public <T> T getNested(String key, T defaultValue)
      Deprecated.
    • getNestedAs

      @Deprecated public <T> T getNestedAs(String key, Class<T> type)
      Deprecated.
      use get(String) instead
    • removeNested

      @Deprecated public void removeNested(String key)
      Deprecated.
      use remove(String) instead
    • getKeys

      public Set<String> getKeys()
    • getKeys

      public Set<String> getKeys(boolean child)