Class RulesVersion
java.lang.Object
software.amazon.smithy.rulesengine.language.RulesVersion
- All Implemented Interfaces:
Comparable<RulesVersion>
Represents the rules engine version with major and minor components.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(RulesVersion other) booleanintgetMajor()Gets the major version component.intgetMinor()Gets the minor version component.inthashCode()booleanisAtLeast(RulesVersion other) Checks if this version is at least the specified version.static RulesVersionof(int major, int minor) Creates a RulesVersion from components.static RulesVersionCreates a RulesVersion from a string representation.toString()
-
Field Details
-
V1_0
-
V1_1
-
-
Method Details
-
of
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
Creates a RulesVersion from components.- Parameters:
major- the major versionminor- 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
Checks if this version is at least the specified version.- Parameters:
other- the version to compare against- Returns:
- true if this version >= other
-
compareTo
- Specified by:
compareToin interfaceComparable<RulesVersion>
-
equals
-
hashCode
public int hashCode() -
toString
-