Record Class VersionImpl
java.lang.Object
java.lang.Record
org.sonar.java.classpath.VersionImpl
- All Implemented Interfaces:
Comparable<Version>,Version
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVersionImpl(Integer major, Integer minor, Integer patch, String qualifier) Creates an instance of aVersionImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintWarning: this is a partial order: 2.5 and 2.5.1 are incomparable.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.booleanisGreaterThan(String version) booleanisGreaterThan(Version version) booleanisGreaterThanOrEqualTo(String version) booleanisGreaterThanOrEqualTo(Version version) booleanisLowerThan(String version) booleanisLowerThan(Version version) booleanisLowerThanOrEqualTo(String version) booleanisLowerThanOrEqualTo(Version version) major()Returns the value of themajorrecord component.static VersionImplmatcherToVersion(Matcher matcher) matcher must come from a match against a pattern that containsVERSION_REGEXand no other groups.minor()Returns the value of theminorrecord component.static VersionImplpatch()Returns the value of thepatchrecord component.Returns the value of thequalifierrecord 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 aVersionImplrecord class.- Parameters:
major- the value for themajorrecord componentminor- the value for theminorrecord componentpatch- the value for thepatchrecord componentqualifier- the value for thequalifierrecord component
-
-
Method Details
-
matcherToVersion
matcher must come from a match against a pattern that containsVERSION_REGEXand no other groups. -
parse
-
compareTo
Warning: this is a partial order: 2.5 and 2.5.1 are incomparable. Qualifiers are ignored.- Specified by:
compareToin 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:
isGreaterThanOrEqualToin interfaceVersion
-
isGreaterThan
- Specified by:
isGreaterThanin interfaceVersion
-
isLowerThanOrEqualTo
- Specified by:
isLowerThanOrEqualToin interfaceVersion
-
isLowerThan
- Specified by:
isLowerThanin interfaceVersion
-
isGreaterThanOrEqualTo
- Specified by:
isGreaterThanOrEqualToin interfaceVersion
-
isGreaterThan
- Specified by:
isGreaterThanin interfaceVersion
-
isLowerThanOrEqualTo
- Specified by:
isLowerThanOrEqualToin interfaceVersion
-
isLowerThan
- Specified by:
isLowerThanin interfaceVersion
-
major
-
minor
-
patch
-
qualifier
-