Yaml Message Utility - C00kier/CookiersLib GitHub Wiki
Utility class for retrieving and colorizing messages from YAML (FileConfiguration) files.
Get Colorized Message without default message
Retrieves and colorizes a string message from the config by a given key.
getColorizedMessage(FileConfiguration config, String key)
Parameters:
config— configuration file to read fromkey— path to the message string
Returns:
- The
colorized message - A fallback
error message("[key] config key not found") if thekeyis not present
Throws:
IllegalStateExceptionif config isnull
Get Colorized Message with default message
Retrieves and colorizes a string message from the config using a fallback message if the key is not found.
getColorizedMessage(FileConfiguration config, String key, String defaultMessage)
Parameters:
config— configuration file to read fromkey— path to the message stringdefaultMessage— fallback string if the key is missing
Returns:
- The
colorized message(default or found value)
Throws:
IllegalStateExceptionif config isnull
Get list of Colorized Messages
Retrieves and colorizes a list of string messages from the config.
getColorizedMessagesFromList(FileConfiguration config, String key)
Parameters:
config— configuration file to read fromkey— path to the list of messages
Returns:
Listofcolorized strings
Throws:
IllegalStateExceptionif config isnull