IdGenerator@Private public abstract class SequentialNumber extends java.lang.Object implements IdGenerator
| Modifier | Constructor | Description |
|---|---|---|
protected |
SequentialNumber(long initialValue) |
Create a new instance with the given initial value.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
equals(java.lang.Object that) |
|
long |
getCurrentValue() |
|
int |
hashCode() |
|
long |
nextValue() |
Increment and then return the next value.
|
void |
setCurrentValue(long value) |
Set current value.
|
boolean |
setIfGreater(long value) |
|
void |
skipTo(long newValue) |
Skip to the new value.
|
protected SequentialNumber(long initialValue)
initialValue - initialValue.public long getCurrentValue()
public void setCurrentValue(long value)
value - value.public boolean setIfGreater(long value)
public long nextValue()
nextValue in interface IdGeneratorpublic void skipTo(long newValue)
throws java.lang.IllegalStateException
newValue - newValue.java.lang.IllegalStateException - Cannot skip to less than the current value.public boolean equals(java.lang.Object that)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2008–2025 Apache Software Foundation. All rights reserved.