public class StatRepository extends DepotRepository implements Stat.AuxDataSource
DepotRepository.CacheStrategy| Constructor and Description |
|---|
StatRepository(PersistenceContext context)
Constructs a new statistics repository with the specified persistence context.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearMapping(Stat.Type type,
String value)
This is only used for testing.
|
void |
deleteStats(int playerId)
Deletes all stats associated with the specified player.
|
String |
getCodeString(Stat.Type type,
int code)
Maps the specified unique code back to its string value.
|
int |
getStringCode(Stat.Type type,
String value)
Maps the specified string to a unique integer value.
|
ArrayList<Stat> |
loadStats(int playerId)
Loads the stats associated with the specified player.
|
void |
purgePlayers(Collection<Integer> playerIds)
Deletes all data associated with the supplied players.
|
<T extends Stat> |
updateStat(int playerId,
StatModifier<T> modifier)
Applies a modification to a single stat.
|
void |
writeModified(int playerId,
Iterable<Stat> stats)
Writes out any of the stats in the supplied iterable that have been modified since they were
first loaded.
|
void |
writeModified(int playerId,
Stat[] stats)
Writes out any of the stats in the supplied array that have been modified since they were
first loaded.
|
ctx, delete, delete, deleteAll, deleteAll, deleteAll, deleteAll, findAll, findAll, findAll, findAll, findAllKeys, findAllKeys, from, insert, load, load, load, load, loadAll, loadAll, registerMigration, store, update, update, update, updatePartial, updatePartial, updatePartial, updatePartial, updatePartial@Inject public StatRepository(PersistenceContext context)
public <T extends Stat> T updateStat(int playerId, StatModifier<T> modifier)
Stat.Type.newStat().public ArrayList<Stat> loadStats(int playerId)
public void deleteStats(int playerId)
public void writeModified(int playerId,
Stat[] stats)
public void writeModified(int playerId,
Iterable<Stat> stats)
public int getStringCode(Stat.Type type, String value)
Stat.AuxDataSourcegetStringCode in interface Stat.AuxDataSourcepublic String getCodeString(Stat.Type type, int code)
Stat.AuxDataSourcegetCodeString in interface Stat.AuxDataSourcepublic void clearMapping(Stat.Type type, String value)
public void purgePlayers(Collection<Integer> playerIds)
Copyright © 2015. All rights reserved.