public class SimpleDriveReader extends Object implements DriveReader
| Constructor and Description |
|---|
SimpleDriveReader() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsObject(Query query)
Does the backend contain one or more objects that can be identified through the query details
|
void |
containsObjectAsync(Query query,
Consumer<Boolean> onResult)
Does the backend contain one or more objects that can be identified through the query details
|
List<DriveObject> |
readAllObjects(Query query)
Read all object instances found by the specified parameters
|
<T> List<T> |
readAllObjects(Query query,
Class<T> clazz)
Read all object instances found by the specified parameters
|
<T> void |
readAllObjects(Query query,
Class<T> clazz,
Consumer<List<T>> onSuccess,
Consumer<Throwable> onError)
Read all object instances found by the specified parameters
|
void |
readAllObjectsAsync(Query query,
Consumer<List<DriveObject>> onResult)
Read all object instances found by the specified parameters
|
DriveObject |
readObject(Query query)
Read the first object instance found by the specified parameters
|
<T> T |
readObject(Query query,
Class<T> clazz)
Read the first object instance found by the specified parameters
|
<T> void |
readObjectAsync(Query query,
Class<T> clazz,
Consumer<T> onSuccess,
Runnable onFailure,
Consumer<Throwable> onError)
Read the first object instance found by the specified parameters
|
void |
readObjectAsync(Query query,
Consumer<DriveObject> onSuccess,
Runnable onFailure)
Read the first object instance found by the specified parameters
|
List<DriveObject> |
readPagedObjects(Query query,
Pageable pageable)
Read all object instances found by the specified parameters
|
<T> List<T> |
readPagedObjects(Query query,
Pageable pageable,
Class<T> clazz)
Read all object instances found by the specified parameters
|
<T> void |
readPagedObjectsAsync(Query query,
Pageable pageable,
Class<T> clazz,
Consumer<List<T>> onSuccess,
Consumer<Throwable> onError)
Read all object instances found by the specified parameters
|
void |
readPagedObjectsAsync(Query query,
Pageable pageable,
Consumer<List<DriveObject>> onResult)
Read all object instances found by the specified parameters
|
void |
setService(DriveService service)
Sets the service the reader is used by.
|
public boolean containsObject(Query query)
containsObject in interface DriveReaderquery - query details used to search for the objectspublic void containsObjectAsync(Query query, Consumer<Boolean> onResult)
containsObjectAsync in interface DriveReaderquery - query details used to search for the objectsonResult - invoked upon resultpublic DriveObject readObject(Query query)
readObject in interface DriveReaderquery - query details used to search for the objectspublic void readObjectAsync(Query query, Consumer<DriveObject> onSuccess, Runnable onFailure)
readObjectAsync in interface DriveReaderquery - query details used to search for the objectsonSuccess - this is invoked if a result is receivedonFailure - this is invoked if no result is foundpublic <T> T readObject(Query query, Class<T> clazz) throws ClassCastException
readObject in interface DriveReaderT - will try to convert the object into the typequery - query details used to search for the objectsclazz - clazz to convert the result intoClassCastException - thrown if found object can not be converted into Tpublic <T> void readObjectAsync(Query query, Class<T> clazz, Consumer<T> onSuccess, Runnable onFailure, Consumer<Throwable> onError)
readObjectAsync in interface DriveReaderT - will try to convert the object into the typequery - query details used to search for the objectsclazz - clazz to convert the result intoonSuccess - invoked upon found resultonFailure - invoked when no result is queriedonError - called if an error occurspublic List<DriveObject> readAllObjects(Query query)
readAllObjects in interface DriveReaderquery - query details used to search for the objectspublic void readAllObjectsAsync(Query query, Consumer<List<DriveObject>> onResult)
readAllObjectsAsync in interface DriveReaderquery - query details used to search for the objectsonResult - invoked upon resultpublic <T> List<T> readAllObjects(Query query, Class<T> clazz) throws ClassCastException
readAllObjects in interface DriveReaderT - will try to convert the objects into the typequery - quarry details used to search for the objectsclazz - clazz to convert the results intoClassCastException - thrown if found objects can not be converted into Tpublic <T> void readAllObjects(Query query, Class<T> clazz, Consumer<List<T>> onSuccess, Consumer<Throwable> onError)
readAllObjects in interface DriveReaderT - will try to convert the objects into the typequery - query details used to search for the objectsclazz - clazz to convert the results intoonSuccess - invoked upon resultonError - called when an error occurspublic List<DriveObject> readPagedObjects(Query query, Pageable pageable)
DriveReaderreadPagedObjects in interface DriveReaderquery - query details used to search for the objectspageable - used for paginationpublic void readPagedObjectsAsync(Query query, Pageable pageable, Consumer<List<DriveObject>> onResult)
DriveReaderreadPagedObjectsAsync in interface DriveReaderquery - query details used to search for the objectspageable - used for paginationonResult - invoked upon resultpublic <T> List<T> readPagedObjects(Query query, Pageable pageable, Class<T> clazz) throws ClassCastException
DriveReaderreadPagedObjects in interface DriveReaderT - will try to convert the objects into the typequery - query details used to search for the objectspageable - used for paginationclazz - clazz to convert the results intoClassCastException - thrown if found objects can not be converted into Tpublic <T> void readPagedObjectsAsync(Query query, Pageable pageable, Class<T> clazz, Consumer<List<T>> onSuccess, Consumer<Throwable> onError)
DriveReaderreadPagedObjectsAsync in interface DriveReaderT - will try to convert the objects into the typequery - query details used to search for the objectspageable - used for paginationclazz - clazz to convert the results intoonSuccess - invoked upon resultonError - called when an error occurspublic void setService(DriveService service)
setService in interface DriveReaderservice - service the reader is used byCopyright © 2020. All rights reserved.