@Qualifier(value="simple") public class InMemoryCounterRepository extends AbstractInMemoryRepository<Counter,java.lang.String> implements CounterRepository
Constructor and Description |
---|
InMemoryCounterRepository() |
Modifier and Type | Method and Description |
---|---|
long |
decrement(java.lang.String name)
Decrement the given counter, creating it if it did not exist.
|
long |
increment(java.lang.String name)
Increment the given counter by one, creating it if it did not exist.
|
long |
increment(java.lang.String name,
long amount)
Increment the given counter by the specified amount, creating it if it did not exist.
|
protected java.lang.String |
keyFor(Counter entity) |
void |
reset(java.lang.String name)
Reset the given counter to zero.
|
buildMap, count, delete, delete, deleteAll, findAll, findAll, findAll, findAllInRange, findOne, save, slice
delete, exists, findAll, save
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findAll, findAll
count, delete, delete, delete, deleteAll, exists, findAll, findAll, findOne, save, save
findAllInRange
public long increment(java.lang.String name)
CounterRepository
increment
in interface CounterRepository
public long increment(java.lang.String name, long amount)
CounterRepository
increment
in interface CounterRepository
public long decrement(java.lang.String name)
CounterRepository
decrement
in interface CounterRepository
public void reset(java.lang.String name)
CounterRepository
reset
in interface CounterRepository
protected java.lang.String keyFor(Counter entity)
keyFor
in class AbstractInMemoryRepository<Counter,java.lang.String>