Class ExactVersionConstraint

java.lang.Object
one.pkg.tinyutils.minecraft.version.constraint.ExactVersionConstraint
All Implemented Interfaces:
VersionConstraint

public class ExactVersionConstraint extends Object implements VersionConstraint
  • Constructor Details

    • ExactVersionConstraint

      public ExactVersionConstraint(String versionStr)
  • Method Details

    • satisfies

      public boolean satisfies(Version version)
      Description copied from interface: VersionConstraint
      Determines if the given version satisfies the constraints defined by this implementation.
      Specified by:
      satisfies in interface VersionConstraint
      Parameters:
      version - the version to be checked against the constraints
      Returns:
      true if the version satisfies the constraints, false otherwise
    • original

      public String original()
      Description copied from interface: VersionConstraint
      Retrieves the original constraint string as it was input or defined.
      Specified by:
      original in interface VersionConstraint
      Returns:
      the original version constraint string that was used to create this constraint.
    • getVersions

      public List<String> getVersions()
      Description copied from interface: VersionConstraint
      Retrieves a list of version constraints represented as strings.

      This method aggregates all conditions that define valid versions and returns them in a standardized string format for further interpretation or display.

      Specified by:
      getVersions in interface VersionConstraint
      Returns:
      a list of strings where each string specifies a version constraint.
    • getLowVersion

      public String getLowVersion()
      Description copied from interface: VersionConstraint
      Retrieves the lowest version that satisfies the version constraint.

      The result depends on how the specific implementation computes the lowest version. It may return null if the constraint defines no minimum version.

      Specified by:
      getLowVersion in interface VersionConstraint
      Returns:
      the lowest version as a string
    • getMaxVersion

      public String getMaxVersion()
      Description copied from interface: VersionConstraint
      Retrieves the highest version defined by the version constraint.

      Depending on the implementing class, this may involve calculating the maximum version based on one or more underlying version constraints.

      Specified by:
      getMaxVersion in interface VersionConstraint
      Returns:
      the maximum version as a string