Package ch.autumo.commons.application
Class AbstractVersion
java.lang.Object
ch.autumo.commons.application.AbstractVersion
- All Implemented Interfaces:
RegistrationVersion
Abstract version for update/upgrade handling.
-
Nested Class Summary
Modifier and TypeClassDescriptionfinal class
A version entry from the XML. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetCurrentVersion
(String appVersion) Get current APP version from loaded versions, not registration version.final String
Return a compressed version string: E.g.abstract String
The registration key stays the same for the same product.final String
Get the salt which is a combination of version and key.abstract String
Registration version ('x.y.z'), e.g.static double
getVersion
(String version) Get a version from string.hasFreeUpgrade
(String appVersion) Check if a free upgrade is available based on loaded versions.hasUpgrade
(String appVersion) Check if an upgrade is available based on loaded versions.boolean
isLoaded()
Are versions loaded from XML?void
load
(InputStreamReader reader) Load a version history file (XML).toString()
Get loaded versions.
-
Constructor Details
-
AbstractVersion
public AbstractVersion()
-
-
Method Details
-
getRegistrationVersion
Description copied from interface:RegistrationVersion
Registration version ('x.y.z'), e.g. "1.0.0". Change this if you want to jump to a new license key (purchase necessary).- Specified by:
getRegistrationVersion
in interfaceRegistrationVersion
- Returns:
- registration version
-
getRegistrationKey
Description copied from interface:RegistrationVersion
The registration key stays the same for the same product. Use different keys for different applications! (length = 25 characters)- Specified by:
getRegistrationKey
in interfaceRegistrationVersion
- Returns:
- registration version
-
getKeyRegistrationVersion
Description copied from interface:RegistrationVersion
Return a compressed version string: E.g. "1.2.0" -> "120".- Specified by:
getKeyRegistrationVersion
in interfaceRegistrationVersion
- Returns:
- registered key version representation.
-
getRegistrationSalt
Description copied from interface:RegistrationVersion
Get the salt which is a combination of version and key.- Specified by:
getRegistrationSalt
in interfaceRegistrationVersion
- Returns:
- registration version salt
-
load
Load a version history file (XML).- Parameters:
reader
- version file XML input stream reader
-
hasFreeUpgrade
Check if a free upgrade is available based on loaded versions.- Parameters:
appVersion
- app version "x.x.x"- Returns:
- true if so
-
hasUpgrade
Check if an upgrade is available based on loaded versions.- Parameters:
appVersion
- app version "x.x.x"- Returns:
- true if so
-
getCurrentVersion
Get current APP version from loaded versions, not registration version.- Parameters:
appVersion
- app version "x.x.x"- Returns:
- APP version.
-
getVersion
Get a version from string.- Parameters:
version
- version string- Returns:
- version value
-
isLoaded
public boolean isLoaded()Are versions loaded from XML?- Returns:
- true if so
-
toString
Get loaded versions.
-