Package com.google.cloud.firestore
Class DocumentChange
java.lang.Object
com.google.cloud.firestore.DocumentChange
A DocumentChange represents a change to the documents matching a query. It contains the document
affected and a the type of change that occurred (added, modifed, or removed).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enumeration of snapshot diff types. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if this DocumentChange is equal to the provided object.Returns the newly added or modified document if this DocumentChange is for an updated document.intThe index of the changed document in the result set immediately after this DocumentChange (specifically, supposing that all prior DocumentChange objects and the current DocumentChange object have been applied).intThe index of the changed document in the result set immediately prior to this DocumentChange (specifically, supposing that all prior DocumentChange objects have been applied).getType()inthashCode()toString()
-
Method Details
-
getType
-
getDocument
Returns the newly added or modified document if this DocumentChange is for an updated document. Returns the deleted document if this document change represents a removal.- Returns:
- A snapshot of the new data (for Type.ADDED or Type.MODIFIED) or the removed data (for Type.REMOVED).
-
getOldIndex
public int getOldIndex()The index of the changed document in the result set immediately prior to this DocumentChange (specifically, supposing that all prior DocumentChange objects have been applied). Returns -1 for 'added' events. -
getNewIndex
public int getNewIndex()The index of the changed document in the result set immediately after this DocumentChange (specifically, supposing that all prior DocumentChange objects and the current DocumentChange object have been applied). Returns -1 for 'removed' events. -
equals
Returns true if this DocumentChange is equal to the provided object. -
hashCode
public int hashCode() -
toString
-