Record Class VersionImpl
java.lang.Object
java.lang.Record
org.sonar.java.classpath.VersionImpl
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVersionImpl
(Integer major, Integer minor, Integer patch, String qualifier) Creates an instance of aVersionImpl
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
Warning: this is a partial order: 2.5 and 2.5.1 are incomparable.boolean
Indicates whether some other object is "equal to" this one.int
hashCode()
Returns a hash code value for this object.boolean
isGreaterThan
(String version) boolean
isGreaterThan
(Version version) boolean
isGreaterThanOrEqualTo
(String version) boolean
isGreaterThanOrEqualTo
(Version version) boolean
isLowerThan
(String version) boolean
isLowerThan
(Version version) boolean
isLowerThanOrEqualTo
(String version) boolean
isLowerThanOrEqualTo
(Version version) major()
Returns the value of themajor
record component.static VersionImpl
matcherToVersion
(Matcher matcher) matcher must come from a match against a pattern that containsVERSION_REGEX
and no other groups.minor()
Returns the value of theminor
record component.static VersionImpl
patch()
Returns the value of thepatch
record component.Returns the value of thequalifier
record component.toString()
Returns a string representation of this record class.
-
Field Details
-
VERSION_REGEX
-
-
Constructor Details
-
VersionImpl
public VersionImpl(Integer major, Integer minor, @Nullable Integer patch, @Nullable String qualifier) Creates an instance of aVersionImpl
record class.- Parameters:
major
- the value for themajor
record componentminor
- the value for theminor
record componentpatch
- the value for thepatch
record componentqualifier
- the value for thequalifier
record component
-
-
Method Details
-
matcherToVersion
matcher must come from a match against a pattern that containsVERSION_REGEX
and no other groups. -
parse
-
compareTo
Warning: this is a partial order: 2.5 and 2.5.1 are incomparable. Qualifiers are ignored.- Specified by:
compareTo
in interfaceComparable<Version>
-
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 withObjects::equals(Object,Object)
. -
hashCode
-
toString
-
isGreaterThanOrEqualTo
- Specified by:
isGreaterThanOrEqualTo
in interfaceVersion
-
isGreaterThan
- Specified by:
isGreaterThan
in interfaceVersion
-
isLowerThanOrEqualTo
- Specified by:
isLowerThanOrEqualTo
in interfaceVersion
-
isLowerThan
- Specified by:
isLowerThan
in interfaceVersion
-
isGreaterThanOrEqualTo
- Specified by:
isGreaterThanOrEqualTo
in interfaceVersion
-
isGreaterThan
- Specified by:
isGreaterThan
in interfaceVersion
-
isLowerThanOrEqualTo
- Specified by:
isLowerThanOrEqualTo
in interfaceVersion
-
isLowerThan
- Specified by:
isLowerThan
in interfaceVersion
-
major
-
minor
-
patch
-
qualifier
-