Class VersionSet
- java.lang.Object
-
- org.apache.jackrabbit.core.version.VersionSet
-
- All Implemented Interfaces:
VersionSelector
public class VersionSet extends Object implements VersionSelector
This Class implements a version selector that is based on a set of versions.
-
-
Constructor Summary
Constructors Constructor Description VersionSet(Map<NodeId,InternalVersion> versions)
Creates aChangeSetVersionSelector
that will try to select a version within the given set of versions.VersionSet(Map<NodeId,InternalVersion> versions, boolean dateFallback)
Creates aChangeSetVersionSelector
that will try to select a version in the given set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InternalVersion
select(InternalVersionHistory versionHistory)
Selects a version of the given version history.Map<NodeId,InternalVersion>
versions()
Returns the (modifiable) changeset of this selector.
-
-
-
Constructor Detail
-
VersionSet
public VersionSet(Map<NodeId,InternalVersion> versions)
Creates aChangeSetVersionSelector
that will try to select a version within the given set of versions.- Parameters:
versions
- the set of versions
-
VersionSet
public VersionSet(Map<NodeId,InternalVersion> versions, boolean dateFallback)
Creates aChangeSetVersionSelector
that will try to select a version in the given set.- Parameters:
versions
- the set of versionsdateFallback
- iftrue
date fallback is enabled.
-
-
Method Detail
-
versions
public Map<NodeId,InternalVersion> versions()
Returns the (modifiable) changeset of this selector. the keys of the map are the node ids of the version histories.- Returns:
- the change set
-
select
public InternalVersion select(InternalVersionHistory versionHistory) throws RepositoryException
Selects a version of the given version history. If this VersionSelector is unable to select one, it can returnnull
. Please note, that a version selector is not allowed to return the root version. Selects a version from set having the given version history.- Specified by:
select
in interfaceVersionSelector
- Parameters:
versionHistory
- version history to select a version from- Returns:
- A version or
null
. - Throws:
RepositoryException
- if an error occurs.
-
-