Class Version

java.lang.Object
net.ME1312.Galaxi.Library.Version.Version
All Implemented Interfaces:
Serializable, Comparable<Version>

public final class Version extends Object implements Serializable, Comparable<Version>
Version Class
See Also:
  • Constructor Details

    • Version

      public Version(String string)
      Creates a Version
      Parameters:
      string - Version String
    • Version

      public Version(VersionType type, String string)
      Creates a Version
      Parameters:
      type - Version Type
      string - Version String
    • Version

      public Version(Version parent, String string)
      Creates a Version (Appending the parent)
      Parameters:
      parent - Parent Version
      string - Version String
    • Version

      public Version(Version parent, VersionType type, String string)
      Creates a Version (Appending the parent)
      Parameters:
      parent - Parent Version
      type - Version Type
      string - Version String
    • Version

      public Version(int... ints)
      Creates a Version
      Parameters:
      ints - Version Numbers (Will be separated with dots)
    • Version

      public Version(VersionType type, int... ints)
      Creates a Version
      Parameters:
      type - Version Type
      ints - Version Numbers (Will be separated with dots)
    • Version

      public Version(Version parent, int... ints)
      Creates a Version (Appending the parent)
      Parameters:
      parent - Parent Version
      ints - Version Numbers (Will be separated with dots)
    • Version

      public Version(Version parent, VersionType type, int... ints)
      Creates a Version (Appending the parent)
      Parameters:
      parent - Parent Version
      type - Version Type
      ints - Version Numbers (Will be separated with dots)
  • Method Details

    • fromString

      public static Version fromString(String string)
      Parse a Version from a string
      Parameters:
      string - String to parse
      See Also:
    • toString

      public String toString()
      The default toString() method

      new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      1.0.0/pa7
      Overrides:
      toString in class Object
      Returns:
      Version as a String
    • toFullString

      public String toFullString()
      The full toString() method

      new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      v1.0.0/pa7
      Returns:
      Version as a String
    • toExtendedString

      public String toExtendedString()
      The extended toString() method

      new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      1.0.0 pre-alpha 7
      Returns:
      Version as a String
    • toFullExtendedString

      public String toFullExtendedString()
      The full extended toString() method

      new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      version 1.0.0 pre-alpha 7
      Returns:
      Version as a String
    • toString

      public static String toString(Collection<Version> collection)
      The default toString() method for Collections
      Parameters:
      collection - Version Collection
      Returns:
      Version Collection as a String
      See Also:
    • toFullString

      public static String toFullString(Collection<Version> collection)
      The full toString() method for Collections
      Parameters:
      collection - Version Collection
      Returns:
      Version Collection as a String
      See Also:
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • equals

      public boolean equals(Version version)
      See if Versions are Equal
      Parameters:
      version - Version to Compare to
      Returns:
    • compareTo

      public int compareTo(Version version)
      Compare Versions
      Specified by:
      compareTo in interface Comparable<Version>
      Parameters:
      version - Version to Compare to
    • equals

      public static boolean equals(Version ver1, Version ver2)
      See if Versions are Equal
      Parameters:
      ver1 - Version to Compare
      ver2 - Version to Compare
      Returns:
    • compare

      public static int compare(Version ver1, Version ver2)
      Compare Versions
      Parameters:
      ver1 - Version to Compare
      ver2 - Version to Compare