Class Semver

java.lang.Object
com.hypixel.hytale.common.semver.Semver
All Implemented Interfaces:
Comparable<Semver>

public class Semver extends Object implements Comparable<Semver>
  • Field Details

  • Constructor Details

    • Semver

      public Semver(long major, long minor, long patch)
    • Semver

      public Semver(long major, long minor, long patch, String[] preRelease, String build)
  • Method Details

    • getMajor

      public long getMajor()
    • getMinor

      public long getMinor()
    • getPatch

      public long getPatch()
    • getPreRelease

      public String[] getPreRelease()
    • hasPreRelease

      public boolean hasPreRelease()
    • getBuild

      public String getBuild()
    • satisfies

      public boolean satisfies(@Nonnull SemverRange range)
    • compareTo

      public int compareTo(@Nonnull Semver other)
      Returns -1 if this Semver is a lower version and 1 if this Semver is a higher version, returning 0 if they are equal.
      Specified by:
      compareTo in interface Comparable<Semver>
      Parameters:
      other -
      Returns:
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object
    • fromString

      @Nonnull public static Semver fromString(String str)
    • fromString

      @Nonnull public static Semver fromString(String str, boolean strict)
      Parse a string to Semver. When strict is set to true we enforce x.y.z if set to false we will allow x and x.y to be parsed by filling in the blanks with zero's
      Parameters:
      str - The string to be parsed.
      strict - Enforce strict Semver parsing.
      Returns:
      The Semver parsed from the string