java.lang.Object | ||
↳ | com.google.android.gms.drive.metadata.MetadataField<T> | |
↳ | com.google.android.gms.drive.metadata.StringMetadataField |
A metadata field which holds a string value of values. Instances of this class (such as the
static values in SearchableField
) can be used to
create "substring" filters for file queries.
For example, the following code will find all files with "pizza" in the title:
Filter titleFilter = Filters.substring(SearchableField.TITLE, "pizza"); Query query = new Query.Builder().addFilters(titleFilter).build(); for (Metadata metadata : Drive.DriveApi.query(apiClient, query).await().getMetadataBuffer()) { System.out.println(metadata.getTitle()); }
Note that you must pass a StringMetadataField
to the Filters.substring
method;
a plain MetadataField
cannot be used as part of an "substring" query. However, every
StringMetadataField
is also a MetadataField
, so you can use a
StringMetadataField
with Filters.eq
(for example, if you want to find a
file with an exact title).
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||||||||||||||||||||||||
![]() |