Class VelocityLanguageConfig

java.lang.Object
de.themoep.utils.lang.LanguageConfig<ninja.leaping.configurate.ConfigurationNode>
de.themoep.utils.lang.velocity.VelocityLanguageConfig

public class VelocityLanguageConfig
extends LanguageConfig<ninja.leaping.configurate.ConfigurationNode>
  • Field Summary

    Fields inherited from class de.themoep.utils.lang.LanguageConfig

    config, configFile, defaultConfig, resourcePath, saveFile
  • Constructor Summary

    Constructors
    Constructor Description
    VelocityLanguageConfig​(Languaged plugin, java.lang.String resourceFolder, java.io.File configFile, java.lang.String locale)  
    VelocityLanguageConfig​(Languaged plugin, java.lang.String resourceFolder, java.io.File configFile, java.lang.String locale, boolean saveFile)  
  • Method Summary

    Modifier and Type Method Description
    boolean contains​(java.lang.String key)
    Check if the config contains a certain key
    boolean contains​(java.lang.String key, boolean checkDefault)
    Check if the config contains a certain key
    java.lang.String get​(java.lang.String key)
    Get a string from the config by its key
    ninja.leaping.configurate.ConfigurationNode getRawConfig()
    Get the raw config object
    void loadConfig()
    Load the config from the file system
    boolean saveConfigResource()
    Save the default config resource from the jar file to the file system

    Methods inherited from class de.themoep.utils.lang.LanguageConfig

    get, get, getLocale, setDefaults

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VelocityLanguageConfig

      public VelocityLanguageConfig​(Languaged plugin, java.lang.String resourceFolder, java.io.File configFile, java.lang.String locale)
    • VelocityLanguageConfig

      public VelocityLanguageConfig​(Languaged plugin, java.lang.String resourceFolder, java.io.File configFile, java.lang.String locale, boolean saveFile)
  • Method Details

    • loadConfig

      public void loadConfig()
      Description copied from class: LanguageConfig
      Load the config from the file system
      Specified by:
      loadConfig in class LanguageConfig<ninja.leaping.configurate.ConfigurationNode>
    • saveConfigResource

      public boolean saveConfigResource()
      Description copied from class: LanguageConfig
      Save the default config resource from the jar file to the file system
      Specified by:
      saveConfigResource in class LanguageConfig<ninja.leaping.configurate.ConfigurationNode>
      Returns:
      Whether or not the file was saved. If it already existed this will return false
    • contains

      public boolean contains​(java.lang.String key)
      Description copied from class: LanguageConfig
      Check if the config contains a certain key
      Specified by:
      contains in class LanguageConfig<ninja.leaping.configurate.ConfigurationNode>
      Parameters:
      key - The key of the string
      Returns:
      true if this config (and not the defaults) has this key, false if not
    • contains

      public boolean contains​(java.lang.String key, boolean checkDefault)
      Description copied from class: LanguageConfig
      Check if the config contains a certain key
      Specified by:
      contains in class LanguageConfig<ninja.leaping.configurate.ConfigurationNode>
      Parameters:
      key - The key of the string
      checkDefault - Whether or not to check the default config
      Returns:
      true if this config (and the default) has this key, false if not
    • get

      public java.lang.String get​(java.lang.String key)
      Description copied from class: LanguageConfig
      Get a string from the config by its key
      Specified by:
      get in class LanguageConfig<ninja.leaping.configurate.ConfigurationNode>
      Parameters:
      key - The key of the string
      Returns:
      The message or an error message if it doesn't exist; never null! (use LanguageConfig.contains(String) to check existance)
    • getRawConfig

      public ninja.leaping.configurate.ConfigurationNode getRawConfig()
      Description copied from class: LanguageConfig
      Get the raw config object
      Specified by:
      getRawConfig in class LanguageConfig<ninja.leaping.configurate.ConfigurationNode>
      Returns:
      The raw config object