Quicknav Quicknav
Links

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

Android Sites

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

close

- - Get Started
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
    - Get the SDK
  - Google Services
- - Google Play
  - Publishing
  - Promoting
  - App Quality
  - Spotlight
  - Open Distribution

## Results

Loading...
Summary: Protected Ctors | Inherited Methods | [Expand All]
public abstract class

# CollectionMetadataField

extends MetadataField<T>

java.lang.Object
↳ | com.google.android.gms.drive.metadata.MetadataField<T>
| ↳ | com.google.android.gms.drive.metadata.CollectionMetadataField<T>

## Class Overview

A metadata field which holds a collection of values. Instances of this class (such as the static values in `SearchableField`) can be used to create "in" filters for file queries.

For example, the following code will find all files in the folder with ID "folder" with the MIME type "text/plain":

     DriveId parent = DriveId.createFromResourceId("folder");
     Filter parentFilter = Filters.in(SearchableField.PARENTS, parent);
     Filter mimeTypeFilter = Filters.eq(SearchableField.MIME_TYPE, "text/plain");
     Query query = new Query.Builder().addFilters(parentFilter, mimeTypeFilter).build();
     for (Metadata metadata : Drive.DriveApi.query(apiClient, query).await().getMetadataBuffer()) {
         System.out.println(metadata.getTitle());
     }

Note that you must pass a `CollectionMetadataField` to the `Filters.in` method; a plain `MetadataField` cannot be used as part of an "in" query. However, every `CollectionMetadataField` is also a `MetadataField`, so you can use a `CollectionMetadataField` with `Filters.eq` (for example, if you want to find a file with an exact set of parents).

## Summary

Protected Constructors
| CollectionMetadataField(String fieldName)

[Expand] Inherited Methods

From class com.google.android.gms.drive.metadata.MetadataField

String | toString()

From class java.lang.Object

Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)

## Protected Constructors

#### protected CollectionMetadataField (String fieldName)