Class SemverRange

java.lang.Object
com.hypixel.hytale.common.semver.SemverRange
All Implemented Interfaces:
SemverSatisfies

public class SemverRange extends Object implements SemverSatisfies
  • Field Details

  • Constructor Details

    • SemverRange

      public SemverRange(SemverSatisfies[] comparators, boolean and)
  • Method Details

    • satisfies

      public boolean satisfies(Semver semver)
      Specified by:
      satisfies in interface SemverSatisfies
    • toString

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

      @Nonnull public static SemverRange fromString(String str)
    • exact

      @Nonnull public static SemverRange exact(@Nonnull Semver version)
      Builds a range satisfied only by exactly the given version, equivalent to the "=x.y.z" form but constructed straight from the Semver -- no toString() round-trip, and no risk of tripping the bare-version parser (a bare "0.8.6" is rejected as a range, since bare forms are only valid when the patch is zero).
      Parameters:
      version - the version to match exactly
      Returns:
      a range that version, and only version, satisfies
    • fromString

      @Nonnull public static SemverRange fromString(String str, boolean strict)