public interface CounterService
Modifier and Type | Method and Description |
---|---|
void |
decrement(java.lang.String name)
Decrement the counter by one
|
Counter |
getOrCreate(java.lang.String name)
Returns an existing counter for the given name or creates a new counter set to zero
|
void |
increment(java.lang.String name)
Increment the counter by one
|
void |
reset(java.lang.String name)
Reset the counter to zero
|
Counter getOrCreate(java.lang.String name)
name
- name of the counterjava.lang.IllegalArgumentException
- in case the given name is nullvoid increment(java.lang.String name)
name
- the counter namejava.lang.IllegalArgumentException
- in case the given name is nullvoid decrement(java.lang.String name)
name
- the counter namejava.lang.IllegalArgumentException
- in case the given name is nullvoid reset(java.lang.String name)
name
- the counter namejava.lang.IllegalArgumentException
- in case the given name is null