Class Version


  • public class Version
    extends java.lang.Object
    This class represents a SemVer version, with an optional patch revision.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Version VERSION
      This library's version, read from the classpath.
    • Constructor Summary

      Constructors 
      Constructor Description
      Version​(int major, int minor, int maintenance, boolean isPreRelease)  
    • Field Detail

      • VERSION

        @Nullable
        public static final Version VERSION
        This library's version, read from the classpath. Can be null if the version resource could not be read.
    • Constructor Detail

      • Version

        public Version​(int major,
                       int minor,
                       int maintenance,
                       boolean isPreRelease)
    • Method Detail

      • parse

        public static Version parse​(java.lang.String version)
        Parse a version string formatted using the standard Maven version format.
        Returns:
        the version, or null if the version could not be parsed.
      • major

        public int major()
      • minor

        public int minor()
      • maintenance

        public int maintenance()
      • isPreRelease

        public boolean isPreRelease()
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

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