AchievementEntity

public final classAchievementEntityextendsObject
implementsParcelableAchievement

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

Field Summary

public static finalCreator<AchievementEntity> CREATOR

Public Method Summary

boolean
Achievement
String
getAchievementId()
Retrieves the ID of this achievement.
int
getCurrentSteps()
Retrieves the number of steps this user has gone toward unlocking this achievement; only applicable for TYPE_INCREMENTALachievement types.
String
getDescription()
Retrieves the description for this achievement.
void
getDescription(CharArrayBuffer dataOut)
Loads the achievement description into the givenCharArrayBuffer.
String
getFormattedCurrentSteps()
Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale); only applicable for TYPE_INCREMENTALachievement types.
void
getFormattedCurrentSteps(CharArrayBuffer dataOut)
Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale) into the givenCharArrayBuffer.
void
getFormattedTotalSteps(CharArrayBuffer dataOut)
Loads the total number of steps necessary to unlock this achievement (formatted for the user's locale) into the givenCharArrayBuffer; only applicable for TYPE_INCREMENTALachievement types.
String
getFormattedTotalSteps()
Retrieves the total number of steps necessary to unlock this achievement, formatted for the user's locale; only applicable for TYPE_INCREMENTALachievement types.
long
getLastUpdatedTimestamp()
Retrieves the timestamp (in millseconds since epoch) at which this achievement was last updated.
void
getName(CharArrayBuffer dataOut)
Loads the achievement name into the givenCharArrayBuffer.
String
getName()
Retrieves the name of this achievement.
Player
getPlayer()
Retrieves the player information associated with this achievement.
Uri
getRevealedImageUri()
Retrieves a URI that can be used to load the achievement's revealed image icon.
String
int
getState()
Returns the Achievement.AchievementStateof the achievement.
int
getTotalSteps()
Retrieves the total number of steps necessary to unlock this achievement; only applicable for TYPE_INCREMENTALachievement types.
int
getType()
Returns the Achievement.AchievementTypeof this achievement.
Uri
getUnlockedImageUri()
Retrieves a URI that can be used to load the achievement's unlocked image icon.
String
long
getXpValue()
Retrieves the XP value of this achievement.
int
boolean
String
void
writeToParcel(Parceldest, int flags)

Inherited Method Summary

Fields

public static finalCreator<AchievementEntity> CREATOR

Public Methods

public booleanequals(Objectobj)

publicAchievement freeze()

publicStringgetAchievementId()

Retrieves the ID of this achievement.

Returns
  • The achievement ID.

public intgetCurrentSteps()

Retrieves the number of steps this user has gone toward unlocking this achievement; only applicable for TYPE_INCREMENTALachievement types.

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

publicStringgetDescription()

Retrieves the description for this achievement.

Returns
  • The achievement description.

public voidgetDescription(CharArrayBuffer dataOut)

Loads the achievement description into the givenCharArrayBuffer.

Parameters
dataOut The buffer to load the data into.

publicStringgetFormattedCurrentSteps()

Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale); only applicable for TYPE_INCREMENTALachievement types.

Returns
  • The formatted number of steps this user has gone toward unlocking this achievement ornullif this information is unavailable.

public voidgetFormattedCurrentSteps(CharArrayBuffer dataOut)

Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale) into the givenCharArrayBuffer.

Parameters
dataOut The buffer to load the data into.

public voidgetFormattedTotalSteps(CharArrayBuffer dataOut)

Loads the total number of steps necessary to unlock this achievement (formatted for the user's locale) into the givenCharArrayBuffer; only applicable for TYPE_INCREMENTALachievement types.

Parameters
dataOut The buffer to load the data into.

publicStringgetFormattedTotalSteps()

Retrieves the total number of steps necessary to unlock this achievement, formatted for the user's locale; only applicable for TYPE_INCREMENTALachievement types.

Returns
  • The total number of steps necessary to unlock this achievement or nullif this information is unavailable.

public longgetLastUpdatedTimestamp()

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 voidgetName(CharArrayBuffer dataOut)

Loads the achievement name into the givenCharArrayBuffer.

Parameters
dataOut The buffer to load the data into.

publicStringgetName()

Retrieves the name of this achievement.

Returns
  • The achievement name.

publicPlayer 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 ofFreezable.freeze().

Returns
  • The player associated with this achievement.

publicUrigetRevealedImageUri()

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 theUri,use ImageManager.

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

publicStringgetRevealedImageUrl()

public intgetState()

Returns the Achievement.AchievementStateof the achievement.

public intgetTotalSteps()

Retrieves the total number of steps necessary to unlock this achievement; only applicable for TYPE_INCREMENTALachievement types.

Returns
  • The total number of steps necessary to unlock this achievement.

public intgetType()

Returns the Achievement.AchievementTypeof this achievement.

publicUrigetUnlockedImageUri()

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 theUri,use ImageManager.

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

publicStringgetUnlockedImageUrl()

public longgetXpValue()

Retrieves the XP value of this achievement.

Returns
  • XP value given to players for unlocking this achievement.

public inthashCode()

public booleanisDataValid()

publicStringtoString()

public voidwriteToParcel(Parceldest, int flags)