Class Versions

java.lang.Object
de.craftsblock.craftsnet.utils.versions.Versions

public class Versions extends Object
Utility class for handling version comparison logic in the CNet system.

This class provides methods for determining whether a version string matches a specified comparison operator and compares it to another version. It leverages the Comparison enum to execute the comparisons.

Since:
3.1.0-SNAPSHOT
See Also:
  • Comparison
  • Method Details

    • suitable

      public static boolean suitable(String current, String expected)
      Determines whether the given current version is suitable in comparison to the expected version.
      Parameters:
      current - the current version as a string
      expected - the expected version as a string, which can optionally contain a comparison operator
      Returns:
      true if the current version satisfies the comparison with the expected version, false otherwise
    • verbalCheck

      public static void verbalCheck(CraftsNet craftsNet)
      Checks the version of CraftsNet using the repo server and displays the result in the console.
      Parameters:
      craftsNet - The current CraftsNet instance.