|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface PropertyContainer
Defines a common API for handling properties on both nodes and
relationships.
Properties are key-value pairs. The keys are always strings. Valid property
value types are all the Java primitives (int, byte,
float, etc), java.lang.Strings and arrays of
primitives and Strings.
Please note that Neo does NOT accept arbitrary objects as property
values. setProperty() takes a
java.lang.Object for design reasons only.
| Method Summary | |
|---|---|
Object |
getProperty(String key)
Returns the property value associated with the given key. |
Object |
getProperty(String key,
Object defaultValue)
Returns the property value associated with the given key, or a default value. |
Iterable<String> |
getPropertyKeys()
Returns all currently valid property keys, or an empty iterable if this node has no properties. |
Iterable<Object> |
getPropertyValues()
Returns all currently valid property values, or an empty iterable if this node has no properties. |
boolean |
hasProperty(String key)
Returns true if this node has a property accessible
through the given key, false otherwise. |
Object |
removeProperty(String key)
Removes and returns the property associated with the given key. |
void |
setProperty(String key,
Object value)
Sets the property value for the given key to value. |
| Method Detail |
|---|
boolean hasProperty(String key)
true if this node has a property accessible
through the given key, false otherwise. If key is
null, this method returns false.
key - the property key
true if this node has a property accessible
through the given key, false otherwiseObject getProperty(String key)
String or an array of any of the valid types. If there's
no property associated with key an unchecked exception is
raised. The idiomatic way to make Neo return null for
unknown keys rather than raise an exception is to use a default value:
Object valueOrNull = nodeOrRel.getProperty( key, null )
key - the property key
NotFoundException - if there's no property associated with
key
Object getProperty(String key,
Object defaultValue)
String or an array of any of the valid types.
key - the property keydefaultValue - the default value to return if no property value was
associated with the given key
void setProperty(String key,
Object value)
value. The
property value must be one of the valid property types, i.e:
boolean or boolean[]byte or byte[]short or short[]int or int[]long or long[]float or float[]double or double[]char or char[]java.lang.String or String[]
This means that null is not an accepted property value.
key - the key with which the new property value will be associatedvalue - the new property value, of one of the valid property types
IllegalArgumentException - if value is of an
unsupported type (including null)Object removeProperty(String key)
null is
returned.
key - the property key
Iterable<String> getPropertyKeys()
Iterable<Object> getPropertyValues()
String or an array of any of the
supported types.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||