public class SimpleTransactionIdSupplier extends Object implements IntSupplier
Note the IDs supplied by this class are global across all instances.
| Modifier and Type | Field and Description |
|---|---|
static SimpleTransactionIdSupplier |
INSTANCE
A global default instance.
|
| Constructor and Description |
|---|
SimpleTransactionIdSupplier() |
| Modifier and Type | Method and Description |
|---|---|
int |
getAsInt() |
int |
nextId()
Get the transaction ID that would be returned next from
getAsInt(). |
void |
reset()
Reset the transaction counter.
|
void |
set(int value)
Force the transaction counter to a specific value.
|
public static final SimpleTransactionIdSupplier INSTANCE
public int getAsInt()
getAsInt in interface IntSupplierpublic int nextId()
getAsInt().public void reset()
The next call to getAsInt() will return 1.
public void set(int value)
value - the "next" value to set; the next call to getAsInt() will
return this value