Class GraphEntity
java.lang.Object
redis.clients.jedis.graph.entities.GraphEntity
This is an abstract class for representing a graph entity. A graph entity has an id and a set of
properties. The properties are mapped and accessed by their names.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected long -
Constructor Summary
ConstructorsConstructorDescriptionGraphEntity(int propertiesCapacity) Use this constructor to reduce memory allocations when properties are added to the edge -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProperty(String name, Object value) Adds a property to the entity, by composing name, type and value to a property objectvoidaddProperty(Property property) Add a property to the entitybooleanlonggetId()intgetProperty(String propertyName) inthashCode()voidremoveProperty(String name) voidsetId(long id) abstract StringtoString()
-
Field Details
-
id
protected long id -
propertyMap
-
-
Constructor Details
-
GraphEntity
public GraphEntity() -
GraphEntity
public GraphEntity(int propertiesCapacity) Use this constructor to reduce memory allocations when properties are added to the edge- Parameters:
propertiesCapacity- preallocate the capacity for the properties
-
-
Method Details
-
getId
public long getId()- Returns:
- entity id
-
setId
public void setId(long id) - Parameters:
id- - entity id to be set
-
addProperty
Adds a property to the entity, by composing name, type and value to a property object- Parameters:
name-value-
-
getEntityPropertyNames
- Returns:
- Entity's property names, as a Set
-
addProperty
Add a property to the entity- Parameters:
property-
-
getNumberOfProperties
public int getNumberOfProperties()- Returns:
- number of properties
-
getProperty
- Parameters:
propertyName- - property name as lookup key (String)- Returns:
- property object, or null if key is not found
-
removeProperty
- Parameters:
name- - the name of the property to be removed
-
equals
-
hashCode
public int hashCode() -
toString
-