Class AVersion

  • All Implemented Interfaces:
    java.lang.Comparable<AVersion>

    public class AVersion
    extends java.lang.Object
    implements java.lang.Comparable<AVersion>
    Yet another version pattern implementation.
    • Field Detail

      • VERSION_ZERO

        public static final AVersion VERSION_ZERO
    • Method Detail

      • parse

        public static AVersion parse​(java.lang.String versionString)
        Parses the given version string to AVersion, dropping "qualifier" and trailing '.0' parts.
      • compareTo

        public int compareTo​(AVersion o)
        Specified by:
        compareTo in interface java.lang.Comparable<AVersion>
      • hashCode

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

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

        public AVersion majorMinor()
        Returns a new version consisting only of the major and minor parts of this version number.
      • getMajor

        public java.lang.String getMajor()
        Returns the major part of this version number, which is the number before the first ".". Should the version number not contain a major part, "0" is returned.
      • getMinor

        public java.lang.String getMinor()
        Returns the minor part of this version number, which is the number between the first and second ".". Should the version number not contain a minor part, "0" is returned.