public class CmsWidgetUtil extends java.lang.Object
Constructor and Description |
---|
CmsWidgetUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
generatePipeSeparatedConfigString(java.util.Map<java.lang.String,java.lang.String> options)
Generates a pipe separated option string from the map,
e.g., for {key1 -> value1, key2 -> null, key3 -> value3} the string "key1=value1|key2|key3=value3" will be generated.
|
static boolean |
getBooleanOption(java.util.Map<java.lang.String,java.lang.String> configOptions,
java.lang.String optionKey)
Returns a flag, indicating if a boolean option is set, i.e., it is in the map and has value null or (case-insensitive) "true".
|
static java.lang.String |
getStringOption(java.util.Map<java.lang.String,java.lang.String> configOptions,
java.lang.String optionKey,
java.lang.String defaultValue)
Returns the value of an option, or the default if the value is null or the key is not part of the map.
|
static java.util.Map<java.lang.String,java.lang.String> |
parsePipeSeparatedConfigString(java.lang.String configString)
Parses a pipe-separated config string into a map, converting all keys to lowercase.
|
public CmsWidgetUtil()
public static java.lang.String generatePipeSeparatedConfigString(java.util.Map<java.lang.String,java.lang.String> options)
options
- the map with the config options.public static boolean getBooleanOption(java.util.Map<java.lang.String,java.lang.String> configOptions, java.lang.String optionKey)
configOptions
- the map with the config options.optionKey
- the boolean option to check.public static java.lang.String getStringOption(java.util.Map<java.lang.String,java.lang.String> configOptions, java.lang.String optionKey, java.lang.String defaultValue)
configOptions
- the map with the config options.optionKey
- the option to get the value ofdefaultValue
- the default value to return if the option is not set.public static java.util.Map<java.lang.String,java.lang.String> parsePipeSeparatedConfigString(java.lang.String configString)
configString
- the config string to parse