Package me.hsgamer.hscore.config.proxy
Class ConfigGenerator
java.lang.Object
me.hsgamer.hscore.config.proxy.ConfigGenerator
The main class of the config proxy system.
Use this class to create a proxied interface with a config.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
newInstance
(Class<T> clazz, Config config) Create a new mapped instance of the class from the config, also set up the configstatic <T> T
newInstance
(Class<T> clazz, Config config, boolean setupConfig) Create a new mapped instance of the class from the configstatic <T> T
newInstance
(Class<T> clazz, Config config, boolean setupConfig, boolean stickyValue) Create a new mapped instance of the class from the configstatic <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
-
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 createconfig
- The config to usesetupConfig
- Whether to set up the configstickyValue
- 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 createconfig
- The config to usesetupConfig
- Whether to set up the configstickyValue
- True if the value should be sticky (keep the value in the cache)- Returns:
- The new instance
-
newInstance
Create a new mapped instance of the class from the config- Type Parameters:
T
- The class type- Parameters:
clazz
- The class to createconfig
- The config to usesetupConfig
- Whether to set up the config- Returns:
- The new instance
-
newInstance
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 createconfig
- The config to use- Returns:
- The new instance
-