SearchableMetadataField | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Analyze
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: | [Expand All]
public interface

# SearchableMetadataField

implements MetadataField<T>

com.google.android.gms.drive.metadata.SearchableMetadataField<T>

Known Indirect Subclasses SearchableCollectionMetadataField<T>, SearchableOrderedMetadataField<T>
SearchableCollectionMetadataField<T> | Interface for metadata fields which hold a collection of values.
SearchableOrderedMetadataField<T> | Interface for metadata fields which holds an ordered value (such as a date) and which can be used for range queries.

## Class Overview

Interface for metadata fields that can be used to filter results as part of file queries. Implementation of this interface (such as the static values in `SearchableField`) can be used to create filters for file or folder queries.

For example, the following code will find all files that are starred and have the MIME type type "text/plain":

``

     Filter starredFilter = Filters.eq(SearchableField.STARRED, true);
     Filter mimeTypeFilter = Filters.eq(SearchableField.MIME_TYPE, "text/plain");
     Query query = new Query.Builder().addFilters(starredFilter, mimeTypeFilter).build();
     for (Metadata metadata : Drive.DriveApi.query(apiClient, query).await().getMetadataBuffer()) {
         System.out.println(metadata.getTitle());
     }