Class RulesVersion

java.lang.Object
software.amazon.smithy.rulesengine.language.RulesVersion
All Implemented Interfaces:
Comparable<RulesVersion>

public final class RulesVersion extends Object implements Comparable<RulesVersion>
Represents the rules engine version with major and minor components.
  • Field Details

  • Method Details

    • of

      public static RulesVersion of(String version)
      Creates a RulesVersion from a string representation.
      Parameters:
      version - the version string (e.g., "1.0", "1.2")
      Returns:
      the RulesVersion instance
      Throws:
      IllegalArgumentException - if the version string is invalid
    • of

      public static RulesVersion of(int major, int minor)
      Creates a RulesVersion from components.
      Parameters:
      major - the major version
      minor - the minor version
      Returns:
      the RulesVersion instance
    • getMajor

      public int getMajor()
      Gets the major version component.
      Returns:
      the major version
    • getMinor

      public int getMinor()
      Gets the minor version component.
      Returns:
      the minor version
    • isAtLeast

      public boolean isAtLeast(RulesVersion other)
      Checks if this version is at least the specified version.
      Parameters:
      other - the version to compare against
      Returns:
      true if this version >= other
    • compareTo

      public int compareTo(RulesVersion other)
      Specified by:
      compareTo in interface Comparable<RulesVersion>
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object