Interface VersionManager
- All Known Implementing Classes:
VersionManagerImpl
public interface VersionManager
Encapsulates version checks
- Author:
- krylov
-
Method Summary
Modifier and TypeMethodDescriptiongetCurrentVersions
(HasVersions object) Returns current versions for the object, i.e. studio and those packages only that the object depends upon.boolean
isCompatible
(HasVersions object) Checks that an object is compatibleboolean
isUpToDate
(HasVersions object) Checks that an object is up to datedefault <T extends HasVersions>
TrequireCompatible
(T object) Throws exception if an object is notcompatible
-
Method Details
-
isUpToDate
Checks that an object is up to date- Parameters:
object
- object with versions to check- Returns:
- true if up to date, false if outdated
- Throws:
UndefinedVersionsException
- if object does not contain versions
-
isCompatible
Checks that an object is compatible- Parameters:
object
- object with versions to check- Returns:
- true if compatible, false if otherwise
- Throws:
UndefinedVersionsException
- if object does not contain versions
-
requireCompatible
Throws exception if an object is notcompatible
- Parameters:
object
- object to check- Returns:
- object
- Throws:
IncompatibleObjectException
- if an object is not compatibleUndefinedVersionsException
- if object does not contain versions
-
getCurrentVersions
Returns current versions for the object, i.e. studio and those packages only that the object depends upon. SeeFileWithVersionsIO.getUsedPackages(HasVersions)
- Parameters:
object
- the object- Returns:
- current studio version and package versions for those packages used by the object
-
getCurrentVersions
Versions getCurrentVersions()- Returns:
- current studio and packages versions
-