Query
Stay organized with collections
Save and categorize content based on your preferences.
The query object specifies constraints on a query result, including filters and sort
order.
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
From interface android.os.Parcelable
abstract int |
describeContents()
|
abstract void |
writeToParcel( Parcel arg0,
int arg1)
|
Public Methods
public Filter
getFilter ()
Get the filters that will restrict the query results.
public String getPageToken ()
This method is deprecated.
Paging is not supported.
A token that indicates the next page of results to retrieve. This should be a token
that was returned in a previous query.
public SortOrder
getSortOrder ()
Returns SortOrder
containing information about sorting order of the query. Can be null
when
no sorting order is added to the query.
public void writeToParcel (Parcel out, int
flags)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eQuery\u003c/code\u003e object defines criteria, including filters and sort order, for retrieving specific data.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods to access filters (\u003ccode\u003egetFilter\u003c/code\u003e), sort order (\u003ccode\u003egetSortOrder\u003c/code\u003e), and a deprecated paging token (\u003ccode\u003egetPageToken\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize the \u003ccode\u003eQuery.Builder\u003c/code\u003e nested class to construct queries.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eQuery\u003c/code\u003e implements \u003ccode\u003eParcelable\u003c/code\u003e, enabling its inclusion in Android parcels for data transfer.\u003c/p\u003e\n"]]],["The `Query` class defines constraints for query results, including filters and sort order. It implements `Parcelable` and provides a `CREATOR` field. Key actions include: retrieving filters via `getFilter()`, obtaining the sort order with `getSortOrder()`, and writing to a parcel using `writeToParcel()`. A `Builder` class exists for creating queries. The method `getPageToken()` is deprecated. The class also includes a `toString()` method and inherited methods from `Object` and `Parcelable`.\n"],null,["# Query\n\npublic class **Query** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) \nThe query object specifies constraints on a query result, including filters and sort\norder. \n\n### Nested Class Summary\n\n|-------|---|---|---------------------------------|\n| class | [Query.Builder](/android/reference/com/google/android/gms/drive/query/Query.Builder) || A builder for creating queries. |\n\n### Inherited Constant Summary\n\nFrom interface android.os.Parcelable \n\n|-----|-------------------------------|---|\n| int | CONTENTS_FILE_DESCRIPTOR | |\n| int | PARCELABLE_WRITE_RETURN_VALUE | |\n\n### Field Summary\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|---|\n| public static final [Creator](//developer.android.com/reference/android/os/Parcelable.Creator.html)\\\u003c[Query](/android/reference/com/google/android/gms/drive/query/Query)\\\u003e | [CREATOR](/android/reference/com/google/android/gms/drive/query/Query#CREATOR) | |\n\n### Public Method Summary\n\n|------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Filter](/android/reference/com/google/android/gms/drive/query/Filter) | [getFilter](/android/reference/com/google/android/gms/drive/query/Query#getFilter())() Get the filters that will restrict the query results. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getPageToken](/android/reference/com/google/android/gms/drive/query/Query#getPageToken())() *This method is deprecated. Paging is not supported.* |\n| [SortOrder](/android/reference/com/google/android/gms/drive/query/SortOrder) | [getSortOrder](/android/reference/com/google/android/gms/drive/query/Query#getSortOrder())() Returns [SortOrder](/android/reference/com/google/android/gms/drive/query/SortOrder) containing information about sorting order of the query. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [toString](/android/reference/com/google/android/gms/drive/query/Query#toString())() |\n| void | [writeToParcel](/android/reference/com/google/android/gms/drive/query/Query#writeToParcel(android.os.Parcel, int))([Parcel](//developer.android.com/reference/android/os/Parcel.html) out, int flags) |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFrom interface android.os.Parcelable \n\n|---------------|--------------------------------------------------------------------------------------------------|\n| abstract int | describeContents() |\n| abstract void | writeToParcel([Parcel](//developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |\n\nFields\n------\n\n#### public static final [Creator](//developer.android.com/reference/android/os/Parcelable.Creator.html)\\\u003c[Query](/android/reference/com/google/android/gms/drive/query/Query)\\\u003e\n**CREATOR**\n\nPublic Methods\n--------------\n\n#### public [Filter](/android/reference/com/google/android/gms/drive/query/Filter)\n**getFilter** ()\n\nGet the filters that will restrict the query results. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getPageToken** ()\n\n**This method is deprecated.** \n\nPaging is not supported. \nA token that indicates the next page of results to retrieve. This should be a token\nthat was returned in a previous query. \n\n#### public [SortOrder](/android/reference/com/google/android/gms/drive/query/SortOrder)\n**getSortOrder** ()\n\nReturns [SortOrder](/android/reference/com/google/android/gms/drive/query/SortOrder)\ncontaining information about sorting order of the query. Can be `null` when\nno sorting order is added to the query. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **toString** ()\n\n#### public void **writeToParcel** ([Parcel](//developer.android.com/reference/android/os/Parcel.html) out, int flags)"]]