Class 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 Detail

      • VersionSet

        public VersionSet​(Map<NodeId,​InternalVersion> versions)
        Creates a ChangeSetVersionSelector 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 a ChangeSetVersionSelector that will try to select a version in the given set.
        Parameters:
        versions - the set of versions
        dateFallback - if true 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 return null. 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 interface VersionSelector
        Parameters:
        versionHistory - version history to select a version from
        Returns:
        A version or null.
        Throws:
        RepositoryException - if an error occurs.