Class Version


  • public class Version
    extends java.lang.Object
    This class solely defines the version numbers of PEGASUS. The template file will be substituted by ant during the built process to compile in the built timestamp.

    When using the class, the methods for the version number digits will always return an integer. In order to obtain the full version number, including any "release candidate" suffices, please prefer the toString method over combining the separate version integers yourself.

    Author:
    Karan Vahi, Jens-S. Vöckler, Gideon Juve
    • Field Detail

      • STAMP_FILENAME

        public static final java.lang.String STAMP_FILENAME
        Basename of the build stamp file.
        See Also:
        Constant Field Values
      • props

        private java.util.Properties props
    • Constructor Detail

      • Version

        public Version()
    • Method Detail

      • instance

        public static Version instance()
        Deprecated.
        Just create a new instance
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getVersion

        public java.lang.String getVersion()
        Returns:
        The pegasus version
      • splitVersion

        private java.lang.String[] splitVersion()
      • getMajor

        public java.lang.String getMajor()
        Returns:
        Major version number
      • getMinor

        public java.lang.String getMinor()
        Returns:
        Minor version number
      • getPatch

        public java.lang.String getPatch()
        Returns:
        Patch version number plus other tags
      • determineBuilt

        public java.lang.String determineBuilt()
        Deprecated.
        Use getTimestamp() instead
        Returns:
        the formatted time stamp of the build.
      • getTimestamp

        public java.lang.String getTimestamp()
        Returns:
        the build timestamp
      • determinePlatform

        public java.lang.String determinePlatform()
        Deprecated.
        Used getPlatform() instead
        Determines the build platform.
        Returns:
        an identifier for the build platform.
      • getPlatform

        public java.lang.String getPlatform()
        Returns:
        The build platform
      • determineInstalled

        public java.lang.String determineInstalled()
        Determines the built and architecture of the installation. These are usually separated by a linear white-space.
        Returns:
        the formatted time stamp of the built, if available, and an identifier for the architecture. An string indicating that the build is unknown is returned on failure.
      • matches

        public boolean matches()
        Determines, if the compiled version and the installed version match. The match is done by comparing the timestamps and architectures.
        Returns:
        true, if versions match, false otherwise.