Package com.coachconnect.config
Class ConfigManager
java.lang.Object
com.coachconnect.config.ConfigManager
Configuration manager for the application. Loads and provides access to application properties.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleangetBooleanProperty(String key, boolean defaultValue) Gets a configuration property value as a boolean.booleangetBooleanPropertyInstance(String key, boolean defaultValue) Instance method to get a boolean property value.static ConfigManagerGets or creates the singleton instance.static intgetIntProperty(String key, int defaultValue) Gets a configuration property value as an integer.intgetIntPropertyInstance(String key, int defaultValue) Instance method to get an integer property value.static StringgetProperty(String key) Gets a configuration property value.static StringgetProperty(String key, String defaultValue) Gets a configuration property value with a default.Instance method to get a property value.getPropertyInstance(String key, String defaultValue) Instance method to get a property value with default.static voidinit()Initialises the configuration manager by loading properties from the configuration file.
-
Method Details
-
getInstance
Gets or creates the singleton instance. -
init
public static void init()Initialises the configuration manager by loading properties from the configuration file. -
getProperty
Gets a configuration property value.- Parameters:
key- The property key.- Returns:
- The property value, or null if not found.
-
getProperty
Gets a configuration property value with a default.- Parameters:
key- The property key.defaultValue- The default value to return if the property is not found.- Returns:
- The property value, or the default value if not found.
-
getIntProperty
Gets a configuration property value as an integer.- Parameters:
key- The property key.defaultValue- The default value to return if the property is not found.- Returns:
- The property value as an integer, or the default value if not found.
-
getBooleanProperty
Gets a configuration property value as a boolean.- Parameters:
key- The property key.defaultValue- The default value to return if the property is not found.- Returns:
- The property value as a boolean, or the default value if not found.
-
getPropertyInstance
Instance method to get a property value. -
getPropertyInstance
Instance method to get a property value with default. -
getIntPropertyInstance
Instance method to get an integer property value. -
getBooleanPropertyInstance
Instance method to get a boolean property value.
-