Version class

Represents a semantic version in Jetleaf with major, minor, and patch components.

This class is used to define precise versions and to compare versions when evaluating version ranges or conditional processing.

Usage Example:

final version = Version(3, 1, 4);
final other = Version.parse('3.2.0');

print(version < other); // true
print(version >= Version(3,1,0)); // true
Implemented types

Constructors

Version(int major, int minor, int patch)
Represents a semantic version in Jetleaf with major, minor, and patch components.
const
Version.parse(String version)
Parses a version string (e.g., '3.1.4') into a Version instance.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
major int
The major version component.
final
minor int
The minor version component.
final
patch int
The patch version component.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

compareTo(Version other) int
Compares this object to another object.
override
equalizedProperties() List<Object?>
Mixin-style contract for value-based equality, hashCode, and toString.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator <(Version other) bool
Returns true if this version is strictly less than other.
operator <=(Version other) bool
Returns true if this version is less than or equal to other.
operator ==(Object other) bool
The equality operator.
inherited
operator >(Version other) bool
Returns true if this version is strictly greater than other.
operator >=(Version other) bool
Returns true if this version is greater than or equal to other.