Class QuerySnapshot
java.lang.Object
com.codename1.cloud.firebase.QuerySnapshot
The state of a listened document or query, with the changes since the
previous delivery.
-
Method Summary
Modifier and TypeMethodDescriptionstatic QuerySnapshotdiff(Map<String, DocumentSnapshot> previous, List<DocumentSnapshot> current, boolean fromPolling) Compares two states.getAdded()Returns
Returns
Returns
Returns
booleanReturns
booleanReturns
-
Method Details
-
diff
public static QuerySnapshot diff(Map<String, DocumentSnapshot> previous, List<DocumentSnapshot> current, boolean fromPolling) Compares two states. Documents are matched by name and a document counts as modified when its update time differs.
Parameters
-
previous: the last delivered documents by name, may be empty -
current: the new documents in result order -
fromPolling: true when the state came from polling
Returns
the snapshot with its changes
-
-
hasNoChanges
public boolean hasNoChanges()Returns
true when nothing was added, modified or removed
-
getDocuments
Returns
every document in the current state
-
getAdded
Returns
documents new since the previous delivery
-
getModified
Returns
documents whose update time changed
-
getRemoved
Returns
documents that left the result
-
isFromPolling
public boolean isFromPolling()Returns
true when this state came from the polling fallback, not the live channel
-