Package com.wowza.wms.application
Class WMSProperties
Object
java.util.AbstractMap<K,V>
java.util.HashMap
com.wowza.wms.application.WMSProperties
- All Implemented Interfaces:
Serializable,Cloneable,Map
WMSProperties: generic properties container used by many class to store extended property information. Acts like a simple Map with some simple utilities for performing type conversion.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcloneProperties(WMSProperties from, WMSProperties to) Copy all properties from "from" properties object to "to" properties object.String[]Return all properties as String[].getMatchingEntries(String prefix, ArrayList<String> types) getProperty(String name) Get property value as generic object.booleangetPropertyBoolean(boolean defaultValue, String... locations) Get property as boolean, return default value if does not exist.booleangetPropertyBoolean(String name, boolean defaultVal) Get property as boolean, return default value if does not exist.doublegetPropertyDouble(double defaultValue, String... locations) Get property as double, return default value if does not exist.doublegetPropertyDouble(String name, double defaultVal) Get property as double, return default value if does not exist.intgetPropertyInt(int defaultValue, String... locations) Get property as int, return default value if does not exist.intgetPropertyInt(String name, int defaultVal) Get property as int, return default value if does not exist.longgetPropertyLong(String name, long defaultVal) Get property as long, return default value if does not exist.getPropertyStr(String name) Get property as StringgetPropertyStr(String name, String defaultVal) Get property as String, return default value if does not exist.getPropertyString(String defaultValue, String... locations) Get property as String, return default value if does not exist.voidloadFromProperties(Properties props) voidvoidsetProperty(String name, Object value) Set property to generic object.toJSON()toString()Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode
-
Constructor Details
-
WMSProperties
public WMSProperties()
-
-
Method Details
-
cloneProperties
Copy all properties from "from" properties object to "to" properties object.- Parameters:
from- source propertiesto- destination properties
-
loadFromProperties
-
setProperty
Set property to generic object.- Parameters:
name- property namevalue- value
-
getProperty
Get property value as generic object.- Parameters:
name- property name- Returns:
- value, null if does not exist
-
getPropertyStr
Get property as String- Parameters:
name- property name- Returns:
- value as String, null if does not exist
-
getPropertyDouble
Get property as double, return default value if does not exist.- Parameters:
defaultValue- property default valuelocations- , an ordered list of property keys to search for- Returns:
- the first property found, defaultVal if does not exist
-
getPropertyBoolean
Get property as boolean, return default value if does not exist.- Parameters:
defaultValue- property default valuelocations- , an ordered list of property keys to search for- Returns:
- the first property found, defaultVal if does not exist
-
getPropertyInt
Get property as int, return default value if does not exist.- Parameters:
defaultValue- property default valuelocations- , an ordered list of property keys to search for- Returns:
- the first property found, defaultVal if does not exist
-
getPropertyString
Get property as String, return default value if does not exist.- Parameters:
defaultValue- property default valuelocations- , an ordered list of property keys to search for- Returns:
- the first property found, defaultVal if does not exist
-
getPropertyStr
Get property as String, return default value if does not exist.- Parameters:
name- property namedefaultVal- default value- Returns:
- value as String, defaultVal if does not exist
-
getPropertyBoolean
Get property as boolean, return default value if does not exist.- Parameters:
name- property namedefaultVal- default value- Returns:
- value as boolean, defaultVal if does not exist
-
getPropertyInt
Get property as int, return default value if does not exist.- Parameters:
name- property namedefaultVal- default value- Returns:
- value as boolean, defaultVal if does not exist
-
getPropertyLong
Get property as long, return default value if does not exist.- Parameters:
name- property namedefaultVal- default value- Returns:
- value as long, defaultVal if does not exist
-
getPropertyDouble
Get property as double, return default value if does not exist.- Parameters:
name- property namedefaultVal- default value- Returns:
- value as double, defaultVal if does not exist
-
getMatchingEntries
-
getAllAsStrings
Return all properties as String[]. Format is "key=value".- Returns:
- all properties as String[]
-
toJSON
-
toString
- Overrides:
toStringin classAbstractMap
-
putAll
-