Summary: Constants | Methods | Inherited Methods | [Expand All]
public interface

# Leaderboard

implements Freezable<Leaderboard>

com.google.android.gms.games.leaderboard.Leaderboard

## Class Overview

Data interface for leaderboard metadata.

## Summary

Constants
int | SCORE_ORDER_LARGER_IS_BETTER | Score order constant for leaderboards where scores are sorted in descending order.
int | SCORE_ORDER_SMALLER_IS_BETTER | Score order constant for leaderboards where scores are sorted in ascending order.

Public Methods
abstract String | getDisplayName() Retrieves the display name of this leaderboard.
abstract void | getDisplayName(CharArrayBuffer dataOut) Loads this leaderboard's display name into the given `CharArrayBuffer`.
abstract Uri | getIconImageUri() Retrieves an image URI that can be used to load this leaderboard's icon, or null if there was a problem retrieving the icon.
abstract String | getLeaderboardId() Retrieves the ID of this leaderboard.
abstract int | getScoreOrder() Retrieves the sort order of scores for this leaderboard.
abstract ArrayList<LeaderboardVariant> | getVariants() Retrieves the `LeaderboardVariant`s for this leaderboard.

[Expand] Inherited Methods
From interface com.google.android.gms.common.data.Freezable
abstract Leaderboard | freeze() Freeze a volatile representation into an immutable representation.
abstract boolean | isDataValid() Check to see if this object is valid for use.

## Constants

#### public static final int SCORE_ORDER_LARGER_IS_BETTER

Score order constant for leaderboards where scores are sorted in descending order.

Constant Value: 1 (0x00000001)

#### public static final int SCORE_ORDER_SMALLER_IS_BETTER

Score order constant for leaderboards where scores are sorted in ascending order.

Constant Value: 0 (0x00000000)

## Public Methods

#### public abstract String getDisplayName ()

Retrieves the display name of this leaderboard.

##### Returns

- Display name of this leaderboard.

#### public abstract void getDisplayName (CharArrayBuffer dataOut)

Loads this leaderboard's display name into the given `CharArrayBuffer`.

##### Parameters

dataOut | The buffer to load the data into.

#### public abstract Uri getIconImageUri ()

Retrieves an image URI that can be used to load this leaderboard's icon, or null if there was a problem retrieving the icon.

To retrieve the Image from the `Uri`, use `ImageManager`.

##### Returns

- A URI that can be used to load this leaderboard's icon, or null if there was a problem retrieving the icon.

#### public abstract String getLeaderboardId ()

Retrieves the ID of this leaderboard.

##### Returns

- The ID of this leaderboard.

#### public abstract int getScoreOrder ()

Retrieves the sort order of scores for this leaderboard. Possible values are `SCORE_ORDER_LARGER_IS_BETTER` or `SCORE_ORDER_SMALLER_IS_BETTER`.

##### Returns

- The score order used by this leaderboard.

#### public abstract ArrayList<LeaderboardVariant> getVariants ()

Retrieves the `LeaderboardVariant`s for this leaderboard. These will be returned sorted by time span first, then by variant type.

Note that these variants are volatile, and are tied to the lifetime of the original buffer.

##### Returns

- A list containing the `LeaderboardVariant`s for this leaderboard.