Class Version

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

    public class Version
    extends java.lang.Object
    implements java.lang.Comparable<Version>
    This class allows us to compare contract versions. It uses semantic version comparison. Class implements Comparable interface. This class was taken from here: https://stackoverflow.com/questions/198431/how-do-you-compare-two-version-strings-in-java/11024200#11024200 Solution provided by: https://stackoverflow.com/users/1445568/alex
    • Constructor Summary

      Constructors 
      Constructor Description
      Version​(java.lang.String version)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(Version that)  
      boolean equals​(java.lang.Object that)  
      java.lang.String get()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Version

        public Version​(java.lang.String version)
    • Method Detail

      • get

        public final java.lang.String get()
      • compareTo

        public int compareTo​(Version that)
        Specified by:
        compareTo in interface java.lang.Comparable<Version>
      • equals

        public boolean equals​(java.lang.Object that)
        Overrides:
        equals in class java.lang.Object