Class Version

java.lang.Object
com.palmergames.bukkit.util.Version
All Implemented Interfaces:
Comparable<Version>

public class Version extends Object implements Comparable<Version>
Represents a numbering system of a string format.
  • Method Details

    • fromString

      public static Version fromString(String version)
      Constructs a Version object from the given string.

      This method will truncate any extraneous characters found after it matches the first qualified version string.

      Parameters:
      version - A string that contains a formatted version.
      Returns:
      A new Version instance from the given string.
    • compareTo

      public int compareTo(@NotNull @NotNull Version that)
      Specified by:
      compareTo in interface Comparable<Version>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object
    • getComponents

      @NotNull public @NotNull String[] getComponents()
      Returns the components of the version separated by .'s
      Returns:
      A string array of the components.
    • isPreRelease

      public boolean isPreRelease()
      Returns:
      Whether the last component is not equal to 0
    • isNewerThanOrEquals

      public boolean isNewerThanOrEquals(@NotNull @NotNull Version other)
      Since:
      0.99.0.8
    • isNewerThan

      public boolean isNewerThan(@NotNull @NotNull Version other)
      Since:
      0.99.0.8
    • isOlderThanOrEquals

      public boolean isOlderThanOrEquals(@NotNull @NotNull Version other)
      Since:
      0.99.0.8
    • isOlderThan

      public boolean isOlderThan(@NotNull @NotNull Version other)
      Since:
      0.99.0.8