A canonical identifier for a Drive resource. The identifier can be converted to a String
representation for storage using
and then later converted back to the ID representation using
can be used to see if two different identifiers refer to the same resource.
|int||RESOURCE_TYPE_FILE||A file resource type, meaning the
|int||RESOURCE_TYPE_FOLDER||A folder resource type, meaning the
|int||RESOURCE_TYPE_UNKNOWN||An unknown resource type, meaning the
Inherited Constant Summary
|public static final Creator<DriveId>||CREATOR|
Public Method Summary
Returns the remote Drive resource id associated with the resource.
Returns a String representation of the ID.
Inherited Method Summary
writeToParcel(Parcel arg0, int arg1)
public static final int RESOURCE_TYPE_FILE
A file resource type, meaning the
corresponds to a file.
public static final int RESOURCE_TYPE_FOLDER
A folder resource type, meaning the
corresponds to a folder.
public static final int RESOURCE_TYPE_UNKNOWN
An unknown resource type, meaning the
corresponds to either a file or a folder.
public DriveFile asDriveFile ()
public DriveFolder asDriveFolder ()
public DriveResource asDriveResource ()
This method is useful when you want to perform actions that are applicable for both
files and folders. You can later cast the returned
depending on the type of this
public final String encodeToString ()
The String representation is not guaranteed to be stable over time for a given
resource so should never be compared for equality. Always use
decodeFromString(String) and then
equals(Object) to compare two identifiers to see if they refer to the same
is stable and can be safely used for
public boolean equals (Object obj)
public String getResourceId ()
Returns the remote Drive resource id associated with the resource. May be
null for local resources that have not yet been synchronized to the Drive
public int getResourceType ()
will only be returned if the
instance has been created using
decodeFromString(String), with an old string that was generated and
persisted by the client with an old version of Google Play Services. If the client is
not encoding, persisting and decoding
this method will always return either
public int hashCode ()
public final String toInvariantString ()
Returns an invariant string for this
is stable over time, so for a given
value will always remain the same, and is guaranteed to be unique for each
client can use it directly to compare equality of
equal if and only if its invariant string is equal.