# AchievementEntity

public final class **AchievementEntity** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
implements [Parcelable](https://developer.android.com/reference/android/os/Parcelable.html) [Achievement](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement) Data object representing a set of Achievement data. This is immutable, and therefore safe
to cache or store. Note, however, that the data it represents may grow stale.

This class exists solely to support parceling these objects and should not be used
directly.

### Inherited Constant Summary

From interface android.os.Parcelable

|---|---|---|
| int | CONTENTS_FILE_DESCRIPTOR |   |
| int | PARCELABLE_WRITE_RETURN_VALUE |   |

From interface [com.google.android.gms.games.achievement.Achievement](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement)

|---|---|---|
| int | [STATE_HIDDEN](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#STATE_HIDDEN) | Constant returned by `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getState()` indicating a hidden achievement. |
| int | [STATE_REVEALED](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#STATE_REVEALED) | Constant returned by `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getState()` indicating a revealed achievement. |
| int | [STATE_UNLOCKED](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#STATE_UNLOCKED) | Constant returned by `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getState()` indicating an unlocked achievement. |
| int | [TYPE_INCREMENTAL](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_INCREMENTAL) | Constant returned by `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getType()` indicating an incremental achievement. |
| int | [TYPE_STANDARD](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_STANDARD) | Constant returned by `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getType()` indicating a standard achievement. |

### Field Summary

|---|---|---|
| public static final [Creator](https://developer.android.com/reference/android/os/Parcelable.Creator.html)\<[AchievementEntity](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity)\> | [CREATOR](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#CREATOR) |   |

### Public Method Summary

|---|---|
| boolean | [equals](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#equals(java.lang.Object))([Object](https://developer.android.com/reference/java/lang/Object.html) obj) |
| [Achievement](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement) | [freeze](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#freeze())() |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getAchievementId](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getAchievementId())() Retrieves the ID of this achievement. |
| int | [getCurrentSteps](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getCurrentSteps())() Retrieves the number of steps this user has gone toward unlocking this achievement; only applicable for `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_INCREMENTAL` achievement types. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getDescription](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getDescription())() Retrieves the description for this achievement. |
| void | [getDescription](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getDescription(android.database.CharArrayBuffer))([CharArrayBuffer](https://developer.android.com/reference/android/database/CharArrayBuffer.html) dataOut) Loads the achievement description into the given `https://developer.android.com/reference/android/database/CharArrayBuffer.html`. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getFormattedCurrentSteps](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getFormattedCurrentSteps())() Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale); only applicable for `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_INCREMENTAL` achievement types. |
| void | [getFormattedCurrentSteps](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getFormattedCurrentSteps(android.database.CharArrayBuffer))([CharArrayBuffer](https://developer.android.com/reference/android/database/CharArrayBuffer.html) dataOut) Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale) into the given `https://developer.android.com/reference/android/database/CharArrayBuffer.html`. |
| void | [getFormattedTotalSteps](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getFormattedTotalSteps(android.database.CharArrayBuffer))([CharArrayBuffer](https://developer.android.com/reference/android/database/CharArrayBuffer.html) dataOut) Loads the total number of steps necessary to unlock this achievement (formatted for the user's locale) into the given `https://developer.android.com/reference/android/database/CharArrayBuffer.html`; only applicable for `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_INCREMENTAL` achievement types. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getFormattedTotalSteps](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getFormattedTotalSteps())() Retrieves the total number of steps necessary to unlock this achievement, formatted for the user's locale; only applicable for `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_INCREMENTAL` achievement types. |
| long | [getLastUpdatedTimestamp](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getLastUpdatedTimestamp())() Retrieves the timestamp (in millseconds since epoch) at which this achievement was last updated. |
| void | [getName](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getName(android.database.CharArrayBuffer))([CharArrayBuffer](https://developer.android.com/reference/android/database/CharArrayBuffer.html) dataOut) Loads the achievement name into the given `https://developer.android.com/reference/android/database/CharArrayBuffer.html`. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getName](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getName())() Retrieves the name of this achievement. |
| [Player](https://developers.google.com/android/reference/com/google/android/gms/games/Player) | [getPlayer](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getPlayer())() Retrieves the player information associated with this achievement. |
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | [getRevealedImageUri](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getRevealedImageUri())() Retrieves a URI that can be used to load the achievement's revealed image icon. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getRevealedImageUrl](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getRevealedImageUrl())() |
| int | [getState](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getState())() Returns the `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement.AchievementState` of the achievement. |
| int | [getTotalSteps](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getTotalSteps())() Retrieves the total number of steps necessary to unlock this achievement; only applicable for `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_INCREMENTAL` achievement types. |
| int | [getType](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getType())() Returns the `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement.AchievementType` of this achievement. |
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | [getUnlockedImageUri](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getUnlockedImageUri())() Retrieves a URI that can be used to load the achievement's unlocked image icon. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getUnlockedImageUrl](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getUnlockedImageUrl())() |
| long | [getXpValue](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#getXpValue())() Retrieves the XP value of this achievement. |
| int | [hashCode](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#hashCode())() |
| boolean | [isDataValid](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#isDataValid())() |
| [String](https://developer.android.com/reference/java/lang/String.html) | [toString](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#toString())() |
| void | [writeToParcel](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity#writeToParcel(android.os.Parcel,%20int))([Parcel](https://developer.android.com/reference/android/os/Parcel.html) dest, int flags) |

### Inherited Method Summary

From class java.lang.Object

|---|---|
| [Object](https://developer.android.com/reference/java/lang/Object.html) | clone() |
| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |
| void | finalize() |
| final [Class](https://developer.android.com/reference/java/lang/Class.html)\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| [String](https://developer.android.com/reference/java/lang/String.html) | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

From interface android.os.Parcelable

|---|---|
| abstract int | describeContents() |
| abstract void | writeToParcel([Parcel](https://developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |

From interface [com.google.android.gms.games.achievement.Achievement](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement)

|---|---|
| abstract [String](https://developer.android.com/reference/java/lang/String.html) | [getAchievementId](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getAchievementId())() Retrieves the ID of this achievement. |
| abstract int | [getCurrentSteps](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getCurrentSteps())() Retrieves the number of steps this user has gone toward unlocking this achievement; only applicable for `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_INCREMENTAL` achievement types. |
| abstract [String](https://developer.android.com/reference/java/lang/String.html) | [getDescription](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getDescription())() Retrieves the description for this achievement. |
| abstract void | [getDescription](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getDescription(android.database.CharArrayBuffer))([CharArrayBuffer](https://developer.android.com/reference/android/database/CharArrayBuffer.html) dataOut) Loads the achievement description into the given `https://developer.android.com/reference/android/database/CharArrayBuffer.html`. |
| abstract void | [getFormattedCurrentSteps](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getFormattedCurrentSteps(android.database.CharArrayBuffer))([CharArrayBuffer](https://developer.android.com/reference/android/database/CharArrayBuffer.html) dataOut) Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale) into the given `https://developer.android.com/reference/android/database/CharArrayBuffer.html`. |
| abstract [String](https://developer.android.com/reference/java/lang/String.html) | [getFormattedCurrentSteps](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getFormattedCurrentSteps())() Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale); only applicable for `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_INCREMENTAL` achievement types. |
| abstract void | [getFormattedTotalSteps](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getFormattedTotalSteps(android.database.CharArrayBuffer))([CharArrayBuffer](https://developer.android.com/reference/android/database/CharArrayBuffer.html) dataOut) Loads the total number of steps necessary to unlock this achievement (formatted for the user's locale) into the given `https://developer.android.com/reference/android/database/CharArrayBuffer.html`; only applicable for `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_INCREMENTAL` achievement types. |
| abstract [String](https://developer.android.com/reference/java/lang/String.html) | [getFormattedTotalSteps](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getFormattedTotalSteps())() Retrieves the total number of steps necessary to unlock this achievement, formatted for the user's locale; only applicable for `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_INCREMENTAL` achievement types. |
| abstract long | [getLastUpdatedTimestamp](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getLastUpdatedTimestamp())() Retrieves the timestamp (in millseconds since epoch) at which this achievement was last updated. |
| abstract void | [getName](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getName(android.database.CharArrayBuffer))([CharArrayBuffer](https://developer.android.com/reference/android/database/CharArrayBuffer.html) dataOut) Loads the achievement name into the given `https://developer.android.com/reference/android/database/CharArrayBuffer.html`. |
| abstract [String](https://developer.android.com/reference/java/lang/String.html) | [getName](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getName())() Retrieves the name of this achievement. |
| abstract [Player](https://developers.google.com/android/reference/com/google/android/gms/games/Player) | [getPlayer](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getPlayer())() Retrieves the player information associated with this achievement. |
| abstract [Uri](https://developer.android.com/reference/android/net/Uri.html) | [getRevealedImageUri](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getRevealedImageUri())() Retrieves a URI that can be used to load the achievement's revealed image icon. |
| abstract int | [getState](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getState())() Returns the `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement.AchievementState` of the achievement. |
| abstract int | [getTotalSteps](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getTotalSteps())() Retrieves the total number of steps necessary to unlock this achievement; only applicable for `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_INCREMENTAL` achievement types. |
| abstract int | [getType](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getType())() Returns the `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement.AchievementType` of this achievement. |
| abstract [Uri](https://developer.android.com/reference/android/net/Uri.html) | [getUnlockedImageUri](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getUnlockedImageUri())() Retrieves a URI that can be used to load the achievement's unlocked image icon. |
| abstract long | [getXpValue](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#getXpValue())() Retrieves the XP value of this achievement. |

From interface com.google.android.gms.common.data.Freezable

|---|---|
| abstract [Achievement](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement) | freeze() |
| abstract boolean | isDataValid() |

## Fields

#### public static final [Creator](https://developer.android.com/reference/android/os/Parcelable.Creator.html)\<[AchievementEntity](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/AchievementEntity)\>
**CREATOR**

## Public Methods

#### public boolean **equals** ([Object](https://developer.android.com/reference/java/lang/Object.html) obj)

#### public [Achievement](https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement)
**freeze** ()

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getAchievementId** ()

Retrieves the ID of this achievement.

##### Returns

- The achievement ID.

#### public int **getCurrentSteps** ()

Retrieves the number of steps this user has gone toward unlocking this achievement;
only applicable for `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_INCREMENTAL` achievement types.

##### Returns

- The number of steps this user has gone toward unlocking this achievement.

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getDescription** ()

Retrieves the description for this achievement.

##### Returns

- The achievement description.

#### public void **getDescription** ([CharArrayBuffer](https://developer.android.com/reference/android/database/CharArrayBuffer.html) dataOut)

Loads the achievement description into the given `https://developer.android.com/reference/android/database/CharArrayBuffer.html`.

##### Parameters

| dataOut | The buffer to load the data into. |
|---|---|

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getFormattedCurrentSteps** ()

Retrieves the number of steps this user has gone toward unlocking this achievement
(formatted for the user's locale); only applicable for `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_INCREMENTAL` achievement types.

##### Returns

- The formatted number of steps this user has gone toward unlocking this achievement or `null` if this information is unavailable.

#### public void **getFormattedCurrentSteps** ([CharArrayBuffer](https://developer.android.com/reference/android/database/CharArrayBuffer.html) dataOut)

Retrieves the number of steps this user has gone toward unlocking this achievement
(formatted for the user's locale) into the given `https://developer.android.com/reference/android/database/CharArrayBuffer.html`.

##### Parameters

| dataOut | The buffer to load the data into. |
|---|---|

#### public void **getFormattedTotalSteps** ([CharArrayBuffer](https://developer.android.com/reference/android/database/CharArrayBuffer.html) dataOut)

Loads the total number of steps necessary to unlock this achievement (formatted for
the user's locale) into the given `https://developer.android.com/reference/android/database/CharArrayBuffer.html`;
only applicable for `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_INCREMENTAL` achievement types.

##### Parameters

| dataOut | The buffer to load the data into. |
|---|---|

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getFormattedTotalSteps** ()

Retrieves the total number of steps necessary to unlock this achievement, formatted
for the user's locale; only applicable for `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_INCREMENTAL` achievement types.

##### Returns

- The total number of steps necessary to unlock this achievement or `null` if this information is unavailable.

#### public long **getLastUpdatedTimestamp** ()

Retrieves the timestamp (in millseconds since epoch) at which this achievement was
last updated. If the achievement has never been updated, this will return -1.

##### Returns

- Timestamp at which this achievement was last updated.

#### public void **getName** ([CharArrayBuffer](https://developer.android.com/reference/android/database/CharArrayBuffer.html) dataOut)

Loads the achievement name into the given `https://developer.android.com/reference/android/database/CharArrayBuffer.html`.

##### Parameters

| dataOut | The buffer to load the data into. |
|---|---|

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getName** ()

Retrieves the name of this achievement.

##### Returns

- The achievement name.

#### public [Player](https://developers.google.com/android/reference/com/google/android/gms/games/Player)
**getPlayer** ()

Retrieves the player information associated with this achievement.

Note that this object is a volatile representation, so it is not safe to cache the
output of this directly. Instead, cache the result of `https://developers.google.com/android/reference/com/google/android/gms/common/data/Freezable#freeze()`.

##### Returns

- The player associated with this achievement.

#### public [Uri](https://developer.android.com/reference/android/net/Uri.html) **getRevealedImageUri** ()

Retrieves a URI that can be used to load the achievement's revealed image icon.
Returns null if the achievement has no revealed image.

To retrieve the Image from the `https://developer.android.com/reference/android/net/Uri.html`, use
`https://developers.google.com/android/reference/com/google/android/gms/common/images/ImageManager`.

##### Returns

- The image URI for the achievement's revealed image icon, or null if the achievement has no revealed image.

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getRevealedImageUrl** ()

#### public int **getState** ()

Returns the `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement.AchievementState` of the achievement.

#### public int **getTotalSteps** ()

Retrieves the total number of steps necessary to unlock this achievement; only
applicable for `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement#TYPE_INCREMENTAL` achievement types.

##### Returns

- The total number of steps necessary to unlock this achievement.

#### public int **getType** ()

Returns the `https://developers.google.com/android/reference/com/google/android/gms/games/achievement/Achievement.AchievementType` of this achievement.

#### public [Uri](https://developer.android.com/reference/android/net/Uri.html) **getUnlockedImageUri** ()

Retrieves a URI that can be used to load the achievement's unlocked image icon.
Returns null if the achievement has no unlocked image.

To retrieve the Image from the `https://developer.android.com/reference/android/net/Uri.html`, use
`https://developers.google.com/android/reference/com/google/android/gms/common/images/ImageManager`.

##### Returns

- The image URI for the achievement's unlocked image icon, or null if the achievement has no unlocked image.

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getUnlockedImageUrl** ()

#### public long **getXpValue** ()

Retrieves the XP value of this achievement.

##### Returns

- XP value given to players for unlocking this achievement.

#### public int **hashCode** ()

#### public boolean **isDataValid** ()

#### public [String](https://developer.android.com/reference/java/lang/String.html) **toString** ()

#### public void **writeToParcel** ([Parcel](https://developer.android.com/reference/android/os/Parcel.html) dest, int flags)