public class SimpleTransactionIdSupplier extends Object implements IntSupplier
Note the IDs supplied by this class are global across all instances.
| Modifier and Type | Field | Description |
|---|---|---|
static SimpleTransactionIdSupplier |
INSTANCE |
A global default instance.
|
| Constructor | Description |
|---|---|
SimpleTransactionIdSupplier() |
| Modifier and Type | Method | 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