Configs¶
-
public class
Configs
¶ Represents all configs as well as the default config, sms-config.json
Methods¶
getConfig¶
-
public Config
getConfig
(String name)¶ Fetches the config with the given name.
Parameters: - name – the name of the config
Throws: - IllegalArgumentException – if a configuration with the given name does not exist
Returns: the config with the given name, never null
getConfigOrDefault¶
-
public Config
getConfigOrDefault
(String name)¶ Returns the config with the given name, or the default config if the provided name is null or empty.
Parameters: - name – the name of the desired configuration, or null/empty string for the default configuration
Throws: - IllegalArgumentException – if a configuration with the given name does not exist
- IllegalStateException – if a blank string is provided and there is no default configuration
Returns: the matching configuration
getDefaultConfig¶
-
public Config
getDefaultConfig
()¶ Returns the default configuration, users can make one of the configurations default.
Throws: - IllegalStateException – if no default configuration is set
Returns: the default configuration, never null
getDefaultConfigName¶
hasConfig¶
isEmpty¶
-
public boolean
isEmpty
()¶ Checks whether there are no configurations available.
Returns: true if there are no configurations, false otherwise