QuestEntity

public final class QuestEntity extends AbstractSafeParcelable
implements Quest

Data object representing the data for a quest. 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 final Creator<QuestEntity> CREATOR

Inherited Field Summary

Public Method Summary

boolean
Quest
freeze()
Freeze a volatile representation into an immutable representation.
long
getAcceptedTimestamp()
Retrieves the timestamp (in milliseconds since epoch) at which this quest was accepted by the player.
Uri
getBannerImageUri()
Retrieves a URI that can be used to load the quest's banner image.
Milestone
getCurrentMilestone()
Retrieves the latest milestone information associated with this quest.
String
getDescription()
Retrieves the description for this quest.
void
getDescription(CharArrayBuffer dataOut)
Loads the quest description into the given CharArrayBuffer.
long
getEndTimestamp()
Timestamp at which this quest will change to STATE_EXPIRED if not accepted, or change to STATE_FAILED if accepted but not completed.
Game
getGame()
Retrieves the game metadata associated with this quest.
Uri
getIconImageUri()
Retrieves a URI that can be used to load the quest's icon image.
long
getLastUpdatedTimestamp()
Retrieves the timestamp (in milliseconds since epoch) at which this quest was last updated.
void
getName(CharArrayBuffer dataOut)
Loads the quest name into the given CharArrayBuffer.
String
getName()
Retrieves the name of this quest.
String
getQuestId()
Retrieves the ID of this quest.
long
getStartTimestamp()
Retrieves the timestamp (in milliseconds since epoch) at which this quest will be available for players to accept.
int
int
boolean
isDataValid()
Check to see if this object is valid for use.
boolean
isEndingSoon()
Indicates whether the quest will be expiring soon
String
void
writeToParcel(Parcel out, int flags)

Inherited Method Summary

Fields

public static final Creator<QuestEntity> CREATOR

Public Methods

public boolean equals (Object obj)

public Quest freeze ()

Freeze a volatile representation into an immutable representation. Objects returned from this call are safe to cache.

Note that the output of freeze may not be identical to the parent object, but should be equal. In other words:

 
 Freezable f1 = new Freezable();
 Freezable f2 = f1.freeze();
 f1 == f2 may not be true.
 f1.equals(f2) will be true.
 
 
Returns
  • A concrete implementation of the data object.

public long getAcceptedTimestamp ()

Retrieves the timestamp (in milliseconds since epoch) at which this quest was accepted by the player. If the quest has never been accepted, this will return UNSET_QUEST_TIMESTAMP. If you are looking for the time that a quest is available to be accepted, see getStartTimestamp(). This value should always be greater than getStartTimestamp() and less than getEndTimestamp()

Returns
  • Timestamp at which this quest was accepted.

public Uri getBannerImageUri ()

Retrieves a URI that can be used to load the quest's banner image. Returns null if the quest has no banner image.

To retrieve the Image from the Uri, use ImageManager.

Returns
  • The image URI for the quest's banner image, or null if the quest has no banner image.

public Milestone getCurrentMilestone ()

Retrieves the latest milestone information associated with this quest.

Returns
  • The latest milestone associated with this quest.

public String getDescription ()

Retrieves the description for this quest.

Returns
  • The quest description.

public void getDescription (CharArrayBuffer dataOut)

Loads the quest description into the given CharArrayBuffer.

Parameters
dataOut The buffer to load the data into.

public long getEndTimestamp ()

Timestamp at which this quest will change to STATE_EXPIRED if not accepted, or change to STATE_FAILED if accepted but not completed.

Returns
  • Timestamp at which this quest will end.

public Game getGame ()

Retrieves the game metadata associated with this quest.

Returns
  • The game associated with the quest.

public Uri getIconImageUri ()

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

To retrieve the Image from the Uri, use ImageManager.

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

public long getLastUpdatedTimestamp ()

Retrieves the timestamp (in milliseconds since epoch) at which this quest was last updated. If the quest has never been updated, this will return UNSET_QUEST_TIMESTAMP.

Returns
  • Timestamp at which this quest was last updated.

public void getName (CharArrayBuffer dataOut)

Loads the quest name into the given CharArrayBuffer.

Parameters
dataOut The buffer to load the data into.

public String getName ()

Retrieves the name of this quest.

Returns
  • The quest name.

public String getQuestId ()

Retrieves the ID of this quest.

Returns
  • The quest ID.

public long getStartTimestamp ()

Retrieves the timestamp (in milliseconds since epoch) at which this quest will be available for players to accept. If you are looking for the time that a quest was accepted by the player, see getAcceptedTimestamp()

Returns
  • Timestamp at which this quest will begin.

public int getState ()

Retrieves the state of the quest - one of STATE_UPCOMING, STATE_OPEN, STATE_COMPLETED, STATE_EXPIRED, STATE_FAILED, STATE_ACCEPTED.

Returns
  • The state of this quest.

public int hashCode ()

public boolean isDataValid ()

Check to see if this object is valid for use. If the object is still volatile, this method will indicate whether or not the object can be safely used. The output of a call to freeze() will always be valid.

Returns
  • whether or not the object is valid for use.

public boolean isEndingSoon ()

Indicates whether the quest will be expiring soon

Returns
  • Is the quest expiring soon.

public String toString ()

public void writeToParcel (Parcel out, int flags)