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

# OrderedMetadataField

extends MetadataField<T>

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

## Class Overview

A metadata field which holds an ordered value (such as a date) which can be used for range queries. Instances of this class (such as the static values in `SearchableField`) can be used to create inequality filters for file queries.

For example, the following code will find all files that were modified in the last hour with the MIME type "text/plain":

     Date oneHourAgo = new Date(System.currentTimeMillis() - (60 * 60 * 1000));
     Filter dateFilter = Filters.greaterThan(SearchableField.MODIFIED_DATE, parent);
     Filter mimeTypeFilter = Filters.eq(SearchableField.MIME_TYPE, "text/plain");
     Query query = new Query.Builder().addFilters(dateFilter, mimeTypeFilter).build();
     for (Metadata metadata : Drive.DriveApi.query(apiClient, query).await().getMetadataBuffer()) {
       System.out.println(metadata.getTitle());
     }

Note that you must pass a DateMetadataField to the `Filters.greaterThan`, `Filters.lessThan`, `Filters.lessThanEquals`, or `Filters.greaterThanEquals` methods; a plain `MetadataField` cannot be used as part of an inequality query. However, every `DateMetadataField` is also a `MetadataField`, so you can use a `DateMetadataField` with `Filters.eq` (for example, if you want to find a file that was modified at an exact time).

## Summary

Protected Constructors
| OrderedMetadataField(String fieldName)
| OrderedMetadataField(String fieldName, Collection<String> dataHolderFieldNames)

[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 OrderedMetadataField (String fieldName)

#### protected OrderedMetadataField (String fieldName, Collection<String> dataHolderFieldNames)