Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public final class QuerySnapshot
- Object
- QuerySnapshot
The state of a listened document or query, with the changes since the
previous delivery.
Methods
Inherited methods
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
previousMap<String, DocumentSnapshot>- the last delivered documents by name, may be empty
currentList<DocumentSnapshot>- the new documents in result order
fromPollingboolean- 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
public List<DocumentSnapshot> getDocuments()Returns
every document in the current state
getAdded
public List<DocumentSnapshot> getAdded()Returns
documents new since the previous delivery
getModified
public List<DocumentSnapshot> getModified()Returns
documents whose update time changed
getRemoved
public List<DocumentSnapshot> 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