Package com.kii.cloud.storage.query
Class KiiQueryResult<T>
- java.lang.Object
-
- com.kii.cloud.storage.query.KiiQueryResult<T>
-
- Type Parameters:
T
- KiiBaseObject
public class KiiQueryResult<T> extends java.lang.Object
Contains the result from Cloud query operation.
-
-
Constructor Summary
Constructors Constructor Description KiiQueryResult(KiiQuery query, java.util.List<T> result, java.lang.String paginationKey, KiiBaseBucket bucket)
Constructs KiiQueryResult
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KiiQuery
getNextKiiQuery()
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,
callgetNextKiiQuery()
and callKiiBucket.query(KiiQuery)
again.KiiQueryResult<T>
getNextQueryResult()
Fetch the query result of next page and update List of data can get bygetResult()
same as callingKiiBucket.query(KiiQuery)
with the query get bygetNextKiiQuery()
NOTE: This api access to server.int
getNextQueryResult(KiiQueryCallBack<T> callback)
Asynchronous call forgetNextQueryResult()
background task will be initiated to execute the task.java.util.List<T>
getResult()
Get the list of KiiBaseObject 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
-
KiiQueryResult
public KiiQueryResult(@Nullable KiiQuery query, @NonNull java.util.List<T> result, @Nullable java.lang.String paginationKey, @NonNull KiiBaseBucket bucket)
Constructs KiiQueryResult
-
-
Method Detail
-
getResult
@NonNull public java.util.List<T> getResult()
Get the list of KiiBaseObject that matches 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.
-
getNextKiiQuery
@Nullable public KiiQuery getNextKiiQuery()
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,
callgetNextKiiQuery()
and callKiiBucket.query(KiiQuery)
again. You'll get result in the query of next page.- Returns:
- KiiQuery to get next page of the query. null when this result is the last part of the query.
-
getNextQueryResult
@NonNull public KiiQueryResult<T> getNextQueryResult() throws java.io.IOException, BadRequestException, UnauthorizedException, ForbiddenException, ConflictException, NotFoundException, UndefinedException
Fetch the query result of next page and update List of data can get bygetResult()
same as callingKiiBucket.query(KiiQuery)
with the query get bygetNextKiiQuery()
NOTE: This api access to server. Should not be executed in UI/Main thread.- Throws:
java.io.IOException
- When network related error has happened/UndefinedException
NotFoundException
ConflictException
ForbiddenException
UnauthorizedException
BadRequestException
java.lang.IllegalStateException
- Thrown when there are no more result to get.- See Also:
getNextQueryResult(KiiQueryCallBack)
-
getNextQueryResult
public int getNextQueryResult(@NonNull KiiQueryCallBack<T> callback)
Asynchronous call forgetNextQueryResult()
background task will be initiated to execute the task.- Parameters:
callback
- notifies events.- Returns:
- task id of this operation. can be used for cancel this operation by
Kii#cancelTask(int)
. - Throws:
java.lang.IllegalStateException
- Thrown when there are no more result to get.
-
-