public class ManualVersioning extends Object implements Versioning
Constructor and Description |
---|
ManualVersioning(Pattern pattern,
String documentVersionId,
String defaultsVersionId)
Creates manually supplied versioning information.
|
Modifier and Type | Method and Description |
---|---|
Version |
getDocumentVersion(Section document,
boolean defaults)
Returns version of the given document (section).
|
Version |
getFirstVersion()
Returns the first version specified by the used pattern.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
updateVersionID
public ManualVersioning(@NotNull Pattern pattern, @Nullable String documentVersionId, @NotNull String defaultsVersionId)
The given IDs are parsed immediately using the pattern; then supplied by the appropriate method implementations.
If the version ID of the defaults is invalid, it is considered illegal and will throw a NullPointerException
. For the document itself, if the version returned is null
, the updater
assigns getFirstVersion()
to it.
pattern
- the patterndocumentVersionId
- the version ID of the documentdefaultsVersionId
- the version ID of the defaults@Nullable public Version getDocumentVersion(@NotNull Section document, boolean defaults)
Versioning
If obtaining version of the defaults (parameter is set to true
), returning null
is
considered illegal and will throw a NullPointerException
. Otherwise, for the document itself, if the
version returned is null
, the updater assigns Versioning.getFirstVersion()
to it.
getDocumentVersion
in interface Versioning
document
- the documentdefaults
- if getting version of the defaultsnull
if it could not be obtained/parsed@NotNull public Version getFirstVersion()
Versioning
getFirstVersion
in interface Versioning
Pattern.getFirstVersion()
Copyright © 2022. All rights reserved.