Class Version

  • All Implemented Interfaces:
    Comparable<Version>

    public class Version
    extends Object
    implements Comparable<Version>
    A class to represent a version information, 3 number: major, minor and build number.
    • Field Detail

      • major

        public final int major
      • minor

        public final int minor
    • Constructor Detail

      • Version

        public Version​(int major,
                       int minor,
                       int build)
      • Version

        public Version​(String version)
    • Method Detail

      • compareTo

        public int compareTo​(Version o)
        Compare with another version.
        Specified by:
        compareTo in interface Comparable<Version>
        Parameters:
        o - another version
        Returns:
        0 if both versions are the same, a negative if the other version is higher and a positive otherwise.
      • equals

        public boolean equals​(Object obj)
        Check if another version is exactly the same as this one.
        Overrides:
        equals in class Object
        Parameters:
        obj - another version object
        Returns:
        true if both versions are the same, false otherwise.
      • compatibleWith

        public boolean compatibleWith​(Version version)