java.lang.Object
java.lang.Record
com.intellij.openapi.util.Version
- All Implemented Interfaces:
Serializable,Comparable<Version>
public record Version(int major, int minor, int bugfix)
extends Record
implements Comparable<Version>, Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionVersion(int major, int minor, int bugfix) Creates an instance of aVersionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintbugfix()Returns the value of thebugfixrecord component.intintintintfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanbooleanbooleanbooleanisOrGreaterThan(@Nullable Integer major) booleanisOrGreaterThan(@Nullable Integer major, @Nullable Integer minor) booleanisOrGreaterThan(@Nullable Integer major, @Nullable Integer minor, @Nullable Integer bugfix) booleanbooleanbooleanintmajor()Returns the value of themajorrecord component.intminor()Returns the value of theminorrecord component.static @Nullable VersionparseVersion(@NotNull String versionString) static StringtoCompactString(int major, int minor, int bugfix) toString()Returns a string representation of this record class.
-
Constructor Details
-
Version
public Version(int major, int minor, int bugfix) Creates an instance of aVersionrecord class.- Parameters:
major- the value for themajorrecord componentminor- the value for theminorrecord componentbugfix- the value for thebugfixrecord component
-
-
Method Details
-
parseVersion
-
is
-
is
-
is
-
isOrGreaterThan
-
isOrGreaterThan
-
isOrGreaterThan
-
lessThan
-
lessThan
-
lessThan
-
compareTo
- Specified by:
compareToin interfaceComparable<Version>
-
compareTo
-
compareTo
-
compareTo
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
toCompactString
- Returns:
- compact string representation in the following form: "n.n", "n.n.n", e.g 1.0, 1.1.0
-
toCompactString
-
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
major
public int major()Returns the value of themajorrecord component.- Returns:
- the value of the
majorrecord component
-
minor
public int minor()Returns the value of theminorrecord component.- Returns:
- the value of the
minorrecord component
-
bugfix
public int bugfix()Returns the value of thebugfixrecord component.- Returns:
- the value of the
bugfixrecord component
-