java.lang.Object
com.github.cyberryan1.cybercore.spigot.config.YmlReader
Direct Known Subclasses:
YmlEditor

public class YmlReader extends Object
Allows one to read the data from a YML file.
See Also:
  • Constructor Details

    • YmlReader

      public YmlReader(YmlLoader ymlLoader)
      Constructs a new YmlReader instance using the provided YmlLoader
      Parameters:
      ymlLoader - The YmlLoader to use
    • YmlReader

      public YmlReader(YmlLoader ymlLoader, boolean sendPathNotFoundWarns)
      Constructs a new YmlReader instance using the provided YmlLoader
      Parameters:
      ymlLoader - The YmlLoader to use
      sendPathNotFoundWarns - Whether or not to send warnings when a path is not found
  • Method Details

    • getYmlLoader

      public YmlLoader getYmlLoader()
      Returns:
      The YmlLoader instance
    • getConfig

      public org.bukkit.configuration.file.FileConfiguration getConfig()
      Returns:
      The FileConfiguration provided by the YmlLoader
    • sendPathNotFoundWarns

      public void sendPathNotFoundWarns(boolean sendPathNotFoundErrors)
      Parameters:
      sendPathNotFoundErrors - Whether or not to send warnings when a path is not found
    • isSendingPathNotFoundWarns

      public boolean isSendingPathNotFoundWarns()
      Returns:
      Whether or not warnings are sent when a path is not found
    • getBool

      public boolean getBool(String path)
      First checks if the path is valid, then returns the boolean found at the path
      Parameters:
      path - The path to get the value of
      Returns:
      The boolean found at the path
    • getInt

      public int getInt(String path)
      First checks if the path is valid, then returns the int found at the path
      Parameters:
      path - The path to get the value of
      Returns:
      The int found at the path
    • getLong

      public long getLong(String path)
      First checks if the path is valid, then returns the long found at the path
      Parameters:
      path - The path to get the value of
      Returns:
      The long found at the path
    • getFloat

      public float getFloat(String path)
      First checks if the path is valid, then returns the float found at the path
      Parameters:
      path - The path to get the value of
      Returns:
      The float found at the path
    • getDouble

      public double getDouble(String path)
      First checks if the path is valid, then returns the double found at the path
      Parameters:
      path - The path to get the value of
      Returns:
      The double found at the path
    • getStr

      public String getStr(String path)
      First checks if the path is valid, then returns the string found at the path
      Parameters:
      path - The path to get the value of
      Returns:
      The string found at the path
    • getColoredStr

      public String getColoredStr(String path)
      First checks if the path is valid, then returns the colored string found at the path
      Parameters:
      path - The path to get the value of
      Returns:
      The colored string found at the path
    • getStrList

      public String[] getStrList(String path)
      First checks if the path is valid, then returns the list of strings found at the path
      Parameters:
      path - The path to get the value of
      Returns:
      The list of strings found at the path
    • getColoredStrList

      public String[] getColoredStrList(String path)
      First checks if the path is valid, then returns the list of colored strings found at the path
      Parameters:
      path - The path to get the value of
      Returns:
      The list of colored strings found at the path
    • get

      public Object get(String path)
      First checks if the path is valid, then returns the object found at the path
      Parameters:
      path - The path to get the value of
      Returns:
      The object found at the path
    • getAllKeys

      public ArrayList<String> getAllKeys()
      Returns:
      The list of all paths in the config (deep search)
    • getKeys

      public ArrayList<String> getKeys(String startingPath)
      The list of all paths in the config that start with the provided path (deep search).
      Parameters:
      startingPath - The path to start the search at (should end with a '.')
      Returns:
      The list of all paths in the config that start with the provided path