Package com.deviceatlas
Class Properties
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,Property>
Map String property names to Property objects. An instance of this class
is returned for every getProperties() lookup that properties were found for.
Iteration order is unspecified and differs from
HashMap's. Adding or removing a property the
data file defines while iterating, other than through the iterator, does not throw
ConcurrentModificationException.- 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
ConstructorsConstructorDescriptionProperties(int initialCapacity) Properties(int initialCapacity, float loadFactor) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()clone()A shallow copy, of the same class as this instance.computeIfAbsent(String key, Function<? super String, ? extends Property> f) computeIfPresent(String key, BiFunction<? super String, ? super Property, ? extends Property> f) <T> booleanCheck if a property has a specific value.booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleanvoidforEach(BiConsumer<? super String, ? super Property> action) getOrDefault(Object key, Property defaultValue) getOrDefault(String key, Boolean defaultValue) The method returns the Boolean property value for the specified property name, otherwise the defaultValue is returned instead.getOrDefault(String key, Integer defaultValue) The method returns the Integer property value for the specified property name, otherwise the defaultValue is returned instead.getOrDefault(String key, String defaultValue) The method returns the String property value for the specified property name, otherwise the defaultValue is returned instead.Set<?>getOrDefault(String key, Set<?> defaultValue) The method returns the Set property value for the specified property name, otherwise the defaultValue is returned instead.inthashCode()booleanisEmpty()keySet()merge(String key, Property value, BiFunction<? super Property, ? super Property, ? extends Property> f) voidputIfAbsent(String key, Property value) booleanbooleanvoidreplaceAll(BiFunction<? super String, ? super Property, ? extends Property> f) intsize()toString()values()
-
Constructor Details
-
Properties
public Properties() -
Properties
public Properties(int initialCapacity) -
Properties
public Properties(int initialCapacity, float loadFactor)
-
-
Method Details
-
get
-
containsKey
- Specified by:
containsKeyin interfaceMap<String,Property> - Overrides:
containsKeyin classHashMap<String,Property>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,Property> - Overrides:
containsValuein classHashMap<String,Property>
-
put
-
remove
-
putAll
-
size
public int size() -
isEmpty
public boolean isEmpty() -
clear
public void clear() -
keySet
-
values
-
entrySet
-
getOrDefault
- Specified by:
getOrDefaultin interfaceMap<String,Property> - Overrides:
getOrDefaultin classHashMap<String,Property>
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceMap<String,Property> - Overrides:
putIfAbsentin classHashMap<String,Property>
-
remove
-
replace
-
replace
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceMap<String,Property> - Overrides:
computeIfAbsentin classHashMap<String,Property>
-
computeIfPresent
public Property computeIfPresent(String key, BiFunction<? super String, ? super Property, ? extends Property> f) - Specified by:
computeIfPresentin interfaceMap<String,Property> - Overrides:
computeIfPresentin classHashMap<String,Property>
-
compute
-
merge
-
forEach
-
replaceAll
- Specified by:
replaceAllin interfaceMap<String,Property> - Overrides:
replaceAllin classHashMap<String,Property>
-
equals
-
hashCode
public int hashCode() -
toString
- Overrides:
toStringin classAbstractMap<String,Property>
-
clone
A shallow copy, of the same class as this instance. -
contains
Check if a property has a specific value. Returns false if the property name is invalid or the property does not exists or the value to check is invalid. The value data type should be exactly the same data type as the property. For example do not use values such as "0", "1", 0, 1, 2, -1, "true", "false" for boolean properties.- Parameters:
propertyName- the property to check its valuevalueToCheck- the value to be checked against property's value- Returns:
- true if value to check matches the property's value
-
getOrDefault
The method returns the String property value for the specified property name, otherwise the defaultValue is returned instead.- Parameters:
key-defaultValue-- Returns:
-
getOrDefault
The method returns the Integer property value for the specified property name, otherwise the defaultValue is returned instead.- Parameters:
key-defaultValue-- Returns:
-
getOrDefault
The method returns the Boolean property value for the specified property name, otherwise the defaultValue is returned instead.- Parameters:
key-defaultValue-- Returns:
-
getOrDefault
The method returns the Set property value for the specified property name, otherwise the defaultValue is returned instead.- Parameters:
key-defaultValue-- Returns:
-