Package com.gigaspaces.document
Class DocumentProperties
java.lang.Object
com.gigaspaces.document.DocumentProperties
- All Implemented Interfaces:
Externalizable,Serializable,Map<String,Object>
An implementation of
Map optimized for usage with SpaceDocument.
DocumentProperties contains the following enhancements: 1. Usability: Fluent-styled
setProperty method to enable fluent coding. 2. Serialization performance: Externalizable implementation with special optimization for properties names. 3. Memory
footprint: Open-addressing algorithm is used to conserve memory usage.- Since:
- 8.0
- Author:
- Niv Ingberg
- See Also:
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new DocumentProperties.DocumentProperties(int initialCapacity) Constructs a new DocumentProperties with the specified initial capacity.DocumentProperties(int initialCapacity, float loadFactor) Constructs a new DocumentProperties with the specified initial capacity and load factor.DocumentProperties(Map<String, Object> properties) Constructs a new DocumentProperties with the same properties as the specified Map. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleanCompares the specified object with this map for equality.<T> TgetProperty(String name) Get document property value by nameinthashCode()Returns the hash code value for this map.booleanisEmpty()keySet()voidvoidsetProperty(String name, Object value) Set document propertyintsize()toString()values()voidMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
DocumentProperties
public DocumentProperties()Constructs a new DocumentProperties. -
DocumentProperties
public DocumentProperties(int initialCapacity) Constructs a new DocumentProperties with the specified initial capacity.- Parameters:
initialCapacity- The initial capacity.
-
DocumentProperties
public DocumentProperties(int initialCapacity, float loadFactor) Constructs a new DocumentProperties with the specified initial capacity and load factor.- Parameters:
initialCapacity- The initial capacity.loadFactor- The load factor.
-
DocumentProperties
Constructs a new DocumentProperties with the same properties as the specified Map.- Parameters:
properties- The map whose mappings are to be copied.
-
-
Method Details
-
getProperty
Get document property value by name- Parameters:
name- property name- Returns:
- the property value
-
setProperty
Set document property- Parameters:
name- property namevalue- property value
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<String,Object>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,Object>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
toString
-
equals
Compares the specified object with this map for equality. Returns true if the given object is also a map and the two Maps represent the same mappings. More formally, two maps t1 and t2 represent the same mappings if t1.entrySet().equals(t2.entrySet()). This ensures that the equals method works properly across different implementations of the Map interface. -
hashCode
public int hashCode()Returns the hash code value for this map. The hash code of a map is defined to be the sum of the hashCodes of each entry in the map's entrySet view. This ensures that t1.equals(t2) implies that t1.hashCode()==t2.hashCode() for any two maps t1 and t2, as required by the general contract of Object.hashCode.
-