public final class Versions
extends java.lang.Object
Version
.Modifier and Type | Method and Description |
---|---|
static void |
checkIsIncrement(io.spine.core.Version currentVersion,
io.spine.core.Version newVersion)
Ensures that an entity transits into a new version with a greater number.
|
static io.spine.core.Version |
increment(io.spine.core.Version version)
Creates a new
Version with the number increased by one
and the timestamp of the current system time. |
static io.spine.core.Version |
newVersion(int number,
com.google.protobuf.Timestamp timestamp)
Creates a new instance with the passed number and the timestamp.
|
static io.spine.core.Version |
zero()
Creates a new instance with the zero number and current system time.
|
public static io.spine.core.Version zero()
public static io.spine.core.Version newVersion(int number, com.google.protobuf.Timestamp timestamp)
public static io.spine.core.Version increment(io.spine.core.Version version)
Version
with the number increased by one
and the timestamp of the current system time.public static void checkIsIncrement(io.spine.core.Version currentVersion, io.spine.core.Version newVersion)
currentVersion
- the current version of an entitynewVersion
- the candidate for the new version of the entityjava.lang.IllegalArgumentException
- if newVersion
has less or equal
number with the currentVersion