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

Constants
Creator<ParcelUuid> CREATOR
[Expand]
Inherited Constants
From interface android.os.Parcelable
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

Constants

public static final Creator<ParcelUuid> CREATOR

Since: API Level 5

Public Constructors

public ParcelUuid (UUID uuid)

Since: API Level 5

Constructor creates a ParcelUuid instance from the given UUID.

Parameters
uuid UUID

Public Methods

public int describeContents ()

Since: API Level 5

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

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

public boolean equals (Object object)

Since: 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
  • true if this ParcelUuid is equal to object or false if not.

public static ParcelUuid fromString (String uuid)

Since: API Level 5

Creates a new ParcelUuid from a string representation of UUID.

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

public UUID getUuid ()

Since: API Level 5

Get the UUID represented by the ParcelUuid.

Returns
  • UUID contained in the ParcelUuid.

public int hashCode ()

Since: 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.

Returns
  • this object's hash code.

public String toString ()

Since: API Level 5

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

Returns
  • a String instance.

public void writeToParcel (Parcel dest, int flags)

Since: 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.