QuestEntity | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Inherited Constants | Fields | Inherited Fields | Methods | Inherited Methods | [Expand All]
public final class

# QuestEntity

extends Object
implements SafeParcelable Quest

java.lang.Object
↳ | com.google.android.gms.games.quest.QuestEntity

## Class Overview

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.

## Summary

[Expand] Inherited Constants
From interface android.os.Parcelable
int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |
From interface com.google.android.gms.common.internal.safeparcel.SafeParcelable
String | NULL |
From interface com.google.android.gms.games.quest.Quest
int | STATE_ACCEPTED | Constant returned by `getState()` indicating the player has accepted the quest.
int | STATE_COMPLETED | Constant returned by `getState()` indicating the player has completed the quest.
int | STATE_EXPIRED | Constant returned by `getState()` indicating the quest is over and this player never accepted the quest.
int | STATE_FAILED | Constant returned by `getState()` indicating the quest is over and this player did not complete the quest.
int | STATE_OPEN | Constant returned by `getState()` indicating players can now accept this quest.
int | STATE_UPCOMING | Constant returned by `getState()` indicating the quest happens in the future, so it is visible to the UI, but players can't accept it yet.
long | UNSET_QUEST_TIMESTAMP | The default value for Quest related timestamps when they aren't set by the server.

Fields
public static final QuestEntityCreator | CREATOR |

[Expand] Inherited Fields
From interface com.google.android.gms.games.quest.Quest
public static final int[] | QUEST_STATE_ALL | Array of all the valid state constants.
public static final String[] | QUEST_STATE_NON_TERMINAL |

Public Methods
int | describeContents()
boolean | equals(Object obj)
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 | getState() Retrieves the state of the quest - one of `STATE_UPCOMING`, `STATE_OPEN`, `STATE_COMPLETED`, `STATE_EXPIRED`, `STATE_FAILED`, `STATE_ACCEPTED`.
int | hashCode()
boolean | isDataValid() Check to see if this object is valid for use.
boolean | isEndingSoon() Indicates whether the quest will be expiring soon
String | toString()
void | writeToParcel(Parcel out, int flags)

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
From interface android.os.Parcelable
abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)
From interface com.google.android.gms.common.data.Freezable
abstract T | freeze() Freeze a volatile representation into an immutable representation.
abstract boolean | isDataValid() Check to see if this object is valid for use.
From interface com.google.android.gms.games.quest.Quest
abstract long | getAcceptedTimestamp() Retrieves the timestamp (in milliseconds since epoch) at which this quest was accepted by the player.
abstract Uri | getBannerImageUri() Retrieves a URI that can be used to load the quest's banner image.
abstract Milestone | getCurrentMilestone() Retrieves the latest milestone information associated with this quest.
abstract String | getDescription() Retrieves the description for this quest.
abstract void | getDescription(CharArrayBuffer dataOut) Loads the quest description into the given `CharArrayBuffer`.
abstract 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.
abstract Game | getGame() Retrieves the game metadata associated with this quest.
abstract Uri | getIconImageUri() Retrieves a URI that can be used to load the quest's icon image.
abstract long | getLastUpdatedTimestamp() Retrieves the timestamp (in milliseconds since epoch) at which this quest was last updated.
abstract void | getName(CharArrayBuffer dataOut) Loads the quest name into the given `CharArrayBuffer`.
abstract String | getName() Retrieves the name of this quest.
abstract String | getQuestId() Retrieves the ID of this quest.
abstract long | getStartTimestamp() Retrieves the timestamp (in milliseconds since epoch) at which this quest will be available for players to accept.
abstract int | getState() Retrieves the state of the quest - one of `STATE_UPCOMING`, `STATE_OPEN`, `STATE_COMPLETED`, `STATE_EXPIRED`, `STATE_FAILED`, `STATE_ACCEPTED`.
abstract boolean | isEndingSoon() Indicates whether the quest will be expiring soon

## Fields

#### public static final QuestEntityCreator CREATOR

## Public Methods

#### public int describeContents ()

#### 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)