Package com.tangosol.util
Interface Versionable<T extends Comparable<? super T>>
- Type Parameters:
T
- the type of the version indicator
- All Known Implementing Classes:
JsonMap
public interface Versionable<T extends Comparable<? super T>>
An interface for versionable data.
- Author:
- cp 2000.10.20
-
Method Summary
Modifier and TypeMethodDescriptionGet the version indicator for this object.void
Update the version to the next logical version indicator.default boolean
Return the value specifying if the versioning is enabled.
-
Method Details
-
getVersionIndicator
T getVersionIndicator()Get the version indicator for this object. The version indicator should be an immutable object or one treated as an immutable, which is to say that after the version is incremented, the previous version's indicator reference will never be returned again.- Returns:
- a non-null version value that implements the Comparable interface
-
incrementVersion
void incrementVersion()Update the version to the next logical version indicator.- Throws:
UnsupportedOperationException
- if the object is immutable or if the object does not know how to increment its own version indicator
-
isVersioningEnabled
default boolean isVersioningEnabled()Return the value specifying if the versioning is enabled.- Returns:
- a value specifying if the versioning is enabled
-