Package org.neo4j.graphdb.event
Interface PropertyEntry<T>
- Type Parameters:
T
- The type of the entity the property belongs to, eitherNode
orRelationship
.
public interface PropertyEntry<T>
Represents a changed property.
Instances of this interface represent the property as it is after the
transaction when returned from
TransactionData.assignedNodeProperties()
or
TransactionData.assignedRelationshipProperties()
. Instances of this
interface represent the property as it was before the transaction as well as
how it will be after the transaction has been committed.-
Method Summary
-
Method Details
-
entity
T entity()Get the entity that this property was modified on. The entity is either aNode
or aRelationship
, depending on the generic type of this instance.- Returns:
- the
Node
orRelationship
that the property was modified on.
-
key
String key()Get the key of the modified property.- Returns:
- the key of the modified property.
-
previouslyCommittedValue
Object previouslyCommittedValue()Get the value of the modified property as it was before the transaction (which modified it) started. If thisPropertyEntry
was returned fromTransactionData.assignedNodeProperties()
orTransactionData.assignedRelationshipProperties()
, the value returned from this method is the value that was set forkey
onentity
before the transaction started, ornull
if such a property wasn't set. If thisPropertyEntry
was returned fromTransactionData.removedNodeProperties()
orTransactionData.removedRelationshipProperties()
the value returned from this method is the value that was stored at this property before the transaction started.- Returns:
- The value of the property as it was before the transaction started.
-
value
Object value()Get the value of the modified property. If thisPropertyEntry
was returned fromTransactionData.assignedNodeProperties()
orTransactionData.assignedRelationshipProperties()
, the value returned from this method is the value that will be assigned to the property after the transaction is committed. If thisPropertyEntry
was returned fromTransactionData.removedNodeProperties()
orTransactionData.removedRelationshipProperties()
anIllegalStateException
will be thrown.- Returns:
- The value of the modified property.
- Throws:
IllegalStateException
- if this method is called where this instance represents a removed property.
-