Android APIs
public final class

ParcelUuid

extends Object
implements Parcelable
java.lang.Object
   ↳ android.os.ParcelUuid

Class Overview

This class is a Parcelable wrapper around UUID which is an immutable representation of a 128-bit universally unique identifier.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<ParcelUuid> CREATOR
Public Constructors
ParcelUuid(UUID uuid)
Constructor creates a ParcelUuid instance from the given UUID.
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
boolean equals(Object object)
Compares this ParcelUuid to another object for equality.
static ParcelUuid fromString(String uuid)
Creates a new ParcelUuid from a string representation of UUID.
UUID getUuid()
Get the UUID represented by the ParcelUuid.
int hashCode()
Returns an integer hash code for this object.
String toString()
Returns a string representation of the ParcelUuid For example: 0000110B-0000-1000-8000-00805F9B34FB will be the return value.
void writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<ParcelUuid> CREATOR

Added in API level 5

Public Constructors

public ParcelUuid (UUID uuid)

Added in API level 5

Constructor creates a ParcelUuid instance from the given UUID.

Parameters
uuid UUID

Public Methods

public int describeContents ()

Added in API level 5

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
int a bitmask indicating the set of special object types marshalled by the Parcelable.

public boolean equals (Object object)

Added in API level 5

Compares this ParcelUuid to another object for equality. If object is not null, is a ParcelUuid instance, and all bits are equal, then true is returned.

Parameters
object the Object to compare to.
Returns
boolean true if this ParcelUuid is equal to object or false if not.

public static ParcelUuid fromString (String uuid)

Added in API level 5

Creates a new ParcelUuid from a string representation of UUID.

Parameters
uuid the UUID string to parse.
Returns
ParcelUuid a ParcelUuid instance.
Throws
NullPointerException if uuid is null.
IllegalArgumentException if uuid is not formatted correctly.

public UUID getUuid ()

Added in API level 5

Get the UUID represented by the ParcelUuid.

Returns
UUID UUID contained in the ParcelUuid.

public int hashCode ()

Added in API level 5

Returns an integer hash code for this object. By contract, any two objects for which equals(Object) returns true must return the same hash code value. This means that subclasses of Object usually override both methods or neither method.

Note that hash values must not change over time unless information used in equals comparisons also changes.

See Writing a correct hashCode method if you intend implementing your own hashCode method.

Returns
int this object's hash code.

public String toString ()

Added in API level 5

Returns a string representation of the ParcelUuid For example: 0000110B-0000-1000-8000-00805F9B34FB will be the return value.

Returns
String a String instance.

public void writeToParcel (Parcel dest, int flags)

Added in API level 5

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.