Spring Data Neo4j

org.springframework.data.neo4j.fieldaccess
Class DynamicPropertiesContainer

java.lang.Object
  extended by org.springframework.data.neo4j.fieldaccess.DynamicPropertiesContainer
All Implemented Interfaces:
DynamicProperties

public class DynamicPropertiesContainer
extends Object
implements DynamicProperties


Constructor Summary
DynamicPropertiesContainer()
           
DynamicPropertiesContainer(Map<String,Object> map)
           
 
Method Summary
 Map<String,Object> asMap()
           
 DynamicProperties createFrom(Map<String,Object> map)
          Creates a new instance with the properties set from the given map with DynamicProperties.setPropertiesFrom(Map)
 Object getProperty(String key)
           
 Object getProperty(String key, Object defaultValue)
           
 Iterable<String> getPropertyKeys()
          Returns all keys
 boolean hasProperty(String key)
           
 Object removeProperty(String key)
          Removes the property with the given key
 void setPropertiesFrom(Map<String,Object> m)
          Sets a property for all key/value pairs in the given map
 void setProperty(String key, Object value)
          Set the value of the property with the given key to the given value and overwrites it when such a property already exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicPropertiesContainer

public DynamicPropertiesContainer()

DynamicPropertiesContainer

public DynamicPropertiesContainer(Map<String,Object> map)
Method Detail

hasProperty

public boolean hasProperty(String key)
Specified by:
hasProperty in interface DynamicProperties
Parameters:
key - the key to be checked
Returns:
true if a property with the given key exists

getProperty

public Object getProperty(String key)
Specified by:
getProperty in interface DynamicProperties
Parameters:
key - key of the property to get
Returns:
the property with the given key, or null if no such property exists and DynamicProperties.hasProperty(java.lang.String) returns false

getProperty

public Object getProperty(String key,
                          Object defaultValue)
Specified by:
getProperty in interface DynamicProperties
Parameters:
key - key of the property to get
defaultValue - the default value to return if no property with the given key exists
Returns:
the property with the given key or defaultValue if no such property exists and DynamicProperties.hasProperty(java.lang.String) returns false

setProperty

public void setProperty(String key,
                        Object value)
Description copied from interface: DynamicProperties
Set the value of the property with the given key to the given value and overwrites it when such a property already exists.

Specified by:
setProperty in interface DynamicProperties
Parameters:
key - key of the property
value - value of the property

removeProperty

public Object removeProperty(String key)
Description copied from interface: DynamicProperties
Removes the property with the given key

Specified by:
removeProperty in interface DynamicProperties
Returns:
the property that has been removed or null if no such property exists and DynamicProperties.hasProperty(java.lang.String) returns false

getPropertyKeys

public Iterable<String> getPropertyKeys()
Description copied from interface: DynamicProperties
Returns all keys

Specified by:
getPropertyKeys in interface DynamicProperties
Returns:
iterable over all keys

asMap

public Map<String,Object> asMap()
Specified by:
asMap in interface DynamicProperties
Returns:
a map with all properties key/value pairs

setPropertiesFrom

public void setPropertiesFrom(Map<String,Object> m)
Description copied from interface: DynamicProperties
Sets a property for all key/value pairs in the given map

Specified by:
setPropertiesFrom in interface DynamicProperties
Parameters:
m - that contains the key/value pairs to set

createFrom

public DynamicProperties createFrom(Map<String,Object> map)
Description copied from interface: DynamicProperties
Creates a new instance with the properties set from the given map with DynamicProperties.setPropertiesFrom(Map)

Specified by:
createFrom in interface DynamicProperties
Parameters:
map - that contains the key/value pairs to set
Returns:
a new DynamicProperties instance

Spring Data Neo4j

Copyright © 2011 SpringSource. All Rights Reserved.