Class ConfigGenerator

java.lang.Object
me.hsgamer.hscore.config.proxy.ConfigGenerator

public final class ConfigGenerator extends Object
The main class of the config proxy system. Use this class to create a proxied interface with a config.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> T
    newInstance(Class<T> clazz, Config config)
    Create a new mapped instance of the class from the config, also set up the config
    static <T> T
    newInstance(Class<T> clazz, Config config, boolean setupConfig)
    Create a new mapped instance of the class from the config
    static <T> T
    newInstance(Class<T> clazz, Config config, boolean setupConfig, boolean stickyValue)
    Create a new mapped instance of the class from the config
    static <T> T
    newInstance(Class<T> clazz, Config config, boolean setupConfig, boolean stickyValue, boolean addDefault)
    Create a new mapped instance of the class from the config

    Methods inherited from class java.lang.Object

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

    • newInstance

      public static <T> T newInstance(Class<T> clazz, Config config, boolean setupConfig, boolean stickyValue, boolean addDefault)
      Create a new mapped instance of the class from the config
      Type Parameters:
      T - The class type
      Parameters:
      clazz - The class to create
      config - The config to use
      setupConfig - Whether to set up the config
      stickyValue - True if the value should be sticky (keep the value in the cache)
      addDefault - True if the default value should be added to the config
      Returns:
      The new instance
    • newInstance

      public static <T> T newInstance(Class<T> clazz, Config config, boolean setupConfig, boolean stickyValue)
      Create a new mapped instance of the class from the config
      Type Parameters:
      T - The class type
      Parameters:
      clazz - The class to create
      config - The config to use
      setupConfig - Whether to set up the config
      stickyValue - True if the value should be sticky (keep the value in the cache)
      Returns:
      The new instance
    • newInstance

      public static <T> T newInstance(Class<T> clazz, Config config, boolean setupConfig)
      Create a new mapped instance of the class from the config
      Type Parameters:
      T - The class type
      Parameters:
      clazz - The class to create
      config - The config to use
      setupConfig - Whether to set up the config
      Returns:
      The new instance
    • newInstance

      public static <T> T newInstance(Class<T> clazz, Config config)
      Create a new mapped instance of the class from the config, also set up the config
      Type Parameters:
      T - The class type
      Parameters:
      clazz - The class to create
      config - The config to use
      Returns:
      The new instance