Package com.kii.cloud.storage.query
Class KiiThingQueryResult
- java.lang.Object
-
- com.kii.cloud.storage.query.KiiThingQueryResult
-
public class KiiThingQueryResult extends java.lang.Object
Represents the search result for things.
-
-
Constructor Summary
Constructors Constructor Description KiiThingQueryResult(KiiThingQuery query, java.util.List<KiiThing> result, java.lang.String paginationKey)
Constructs KiiThingQueryResult
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KiiThingQuery
getNextKiiThingQuery()
When there are many result of query or data in result is large,
Query result would be divided into several pages.
To get all result of query, check there are more pages to get by this api and if its true,
callgetNextKiiThingQuery()
and callKiiThing.query(KiiThingQuery)
again.KiiThingQueryResult
getNextResult()
Fetch the query result of next page and update List of data can get bygetResult()
same as callingKiiThing.query(KiiThingQuery)
with the query get bygetNextKiiThingQuery()
NOTE: This api access to server.void
getNextResult(KiiCallback<KiiThingQueryResult> callback)
Asynchronous version ofgetNextResult()
.
Background task will be initiated to execute the task.java.util.List<KiiThing>
getResult()
Get the list of KiiThing that matches the queryboolean
hasNext()
When there are many result of query or data in result is large, Query result would be divided into several pages.
-
-
-
Constructor Detail
-
KiiThingQueryResult
public KiiThingQueryResult(@NonNull KiiThingQuery query, @NonNull java.util.List<KiiThing> result, @Nullable java.lang.String paginationKey)
Constructs KiiThingQueryResult
-
-
Method Detail
-
getResult
@NonNull public java.util.List<KiiThing> getResult()
Get the list of KiiThing that matches the query
-
getNextKiiThingQuery
@Nullable public KiiThingQuery getNextKiiThingQuery()
When there are many result of query or data in result is large,
Query result would be divided into several pages.
To get all result of query, check there are more pages to get by this api and if its true,
callgetNextKiiThingQuery()
and callKiiThing.query(KiiThingQuery)
again. You'll get result in the query of next page.- Returns:
- KiiThingQuery to get next page of the query. null when this result is the last part of the query.
-
hasNext
public boolean hasNext()
When there are many result of query or data in result is large, Query result would be divided into several pages.- Returns:
- true if there are pending result of the Query to be retrieved.
-
getNextResult
@WorkerThread @NonNull public KiiThingQueryResult getNextResult() throws UnauthorizedException, ForbiddenException, BadRequestException, java.io.IOException, ConflictException, NotFoundException, UndefinedException
Fetch the query result of next page and update List of data can get bygetResult()
same as callingKiiThing.query(KiiThingQuery)
with the query get bygetNextKiiThingQuery()
NOTE: This api access to server. Should not be executed in UI/Main thread.- Throws:
UnauthorizedException
ForbiddenException
BadRequestException
java.io.IOException
ConflictException
NotFoundException
UndefinedException
-
getNextResult
public void getNextResult(@NonNull KiiCallback<KiiThingQueryResult> callback)
- Parameters:
callback
- called on completion.
-
-