Class VersionData
- java.lang.Object
-
- io.virtdata.docsys.metafs.fs.renderfs.api.versioning.VersionData
-
-
Constructor Summary
Constructors Constructor Description VersionData()VersionData(Versioned... dependencies)Initialize versions with dependencies only.VersionData(java.util.function.LongSupplier... versionSources)Initialize versions with multiple parts, each having their own way of reading a version value.VersionData(java.util.function.LongSupplier thisVersionSource, Versioned... dependencies)Initialize version data with a separate version source for this element's computed state, as well as references to the dependencies which that state may rely on.
-
Method Summary
Modifier and Type Method Description voidaddVersionDependency(Versioned... dep)longgetMaxDependencyVersion()longgetVersion()Get the version for this element.booleanisValid()If all the versioned parts of this elements are equal or higher version than all of the dependencies, then this element is valid.
-
-
-
Constructor Detail
-
VersionData
public VersionData()
-
VersionData
public VersionData(java.util.function.LongSupplier... versionSources)
Initialize versions with multiple parts, each having their own way of reading a version value.- Parameters:
versionSources- version suppliers for each part of this whole element
-
VersionData
public VersionData(Versioned... dependencies)
Initialize versions with dependencies only. In this form, the effective version of this element is calculated statically as the lowest version of all dependencies at the time of the call.- Parameters:
dependencies- The dependencies of this element as its parts.
-
VersionData
public VersionData(java.util.function.LongSupplier thisVersionSource, Versioned... dependencies)Initialize version data with a separate version source for this element's computed state, as well as references to the dependencies which that state may rely on.- Parameters:
thisVersionSource- A way to derive this element's version value.dependencies- A set of dependencies which may invalidate the state of this element.
-
-
Method Detail
-
getVersion
public long getVersion()
Get the version for this element. An element is considered valid only for other elements of the same version.- Specified by:
getVersionin interfaceVersioned- Returns:
- A long version for the versioned element.
-
getMaxDependencyVersion
public long getMaxDependencyVersion()
-
addVersionDependency
public void addVersionDependency(Versioned... dep)
-
isValid
public boolean isValid()
Description copied from interface:VersionedIf all the versioned parts of this elements are equal or higher version than all of the dependencies, then this element is valid. Said differently, if the highest version of all dependencies is equal to or lower than the lowest version of all the parts, then this element is valid.
-
-