com.threerings.stats.server.persist

## Class StatRecord

- java.lang.Object
- - com.samskivert.depot.impl.QueryResult
  - - com.samskivert.depot.PersistentRecord
    - - com.threerings.stats.server.persist.StatRecord

All Implemented Interfaces:
  Serializable, Cloneable

    public class StatRecord
    extends PersistentRecord

See Also:
  Serialized Form

### Field Summary

Fields
`static Class<StatRecord>` `_R`
`static ColumnExp<Byte>` `MOD_COUNT`
`byte` `modCount` The number of times this stat has been updated, so that simultaneous attempts to update the same stat in the repository can be caught and handled.
`static ColumnExp<Integer>` `PLAYER_ID`
`int` `playerId` The identifier of the player this is a stat for.
`static int` `SCHEMA_VERSION`
`static ColumnExp<Integer>` `STAT_CODE`
`static ColumnExp<byte[]>` `STAT_DATA`
`int` `statCode` The code of the stat.
`byte[]` `statData` The data associated with the stat.

### Constructor Summary

Constructors
Constructor and Description
`StatRecord()` An empty constructor for unmarshalling.
`StatRecord(int playerId, int statCode, byte[] data)` A constructor that populates all our fields.
`StatRecord(int playerId, int statCode, byte[] data, byte modCount)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static Key<StatRecord>` `getKey(int playerId, int statCode)` Create and return a primary `Key` to identify a `StatRecord` with the supplied key values.
`String` `toString()`

### Methods inherited from class com.samskivert.depot.impl.QueryResult

`clone`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### _R

    public static final Class<StatRecord> _R

#### PLAYER_ID

    public static final ColumnExp<Integer> PLAYER_ID

#### STAT_CODE

    public static final ColumnExp<Integer> STAT_CODE

#### STAT_DATA

    public static final ColumnExp<byte[]> STAT_DATA

#### MOD_COUNT

    public static final ColumnExp<Byte> MOD_COUNT

#### SCHEMA_VERSION

    public static final int SCHEMA_VERSION

See Also:
  Constant Field Values

#### playerId

    public int playerId

The identifier of the player this is a stat for.

#### statCode

    public int statCode

The code of the stat.

#### statData

    public byte[] statData

The data associated with the stat.

#### modCount

    public byte modCount

The number of times this stat has been updated, so that simultaneous attempts to update the same stat in the repository can be caught and handled. Stored as a byte because we don't expect to ever have more than a couple simultaneous attempts to update a stat.

### Constructor Detail

#### StatRecord

    public StatRecord()

An empty constructor for unmarshalling.

#### StatRecord

    public StatRecord(int playerId,
                      int statCode,
                      byte[] data)

A constructor that populates all our fields.

#### StatRecord

    public StatRecord(int playerId,
                      int statCode,
                      byte[] data,
                      byte modCount)

### Method Detail

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### getKey

    public static Key<StatRecord> getKey(int playerId,
                                         int statCode)

Create and return a primary `Key` to identify a `StatRecord` with the supplied key values.