Package com.elo.gradle.osgi.utils
Record Class Version.Range
java.lang.Object
java.lang.Record
com.elo.gradle.osgi.utils.Version.Range
- Enclosing class:
Version
public static record Version.Range(String lowerBound, Version minVersion, Version maxVersion, String upperBound)
extends Record
Class representing an OSGi version range.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns whether the min version is inclusive.booleanReturns whether the max version is inclusive.static booleanChecks if a string is a valid version range.Returns the value of thelowerBoundrecord component.Returns the value of themaxVersionrecord component.Returns the value of theminVersionrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theupperBoundrecord component.static Version.RangeParses a version range string into a Range object.
-
Field Details
-
VERSION_RANGE_REGEX
- See Also:
-
-
Constructor Details
-
Range
Creates an instance of aRangerecord class.- Parameters:
lowerBound- the value for thelowerBoundrecord componentminVersion- the value for theminVersionrecord componentmaxVersion- the value for themaxVersionrecord componentupperBound- the value for theupperBoundrecord component
-
-
Method Details
-
isLowerBoundInclusive
public boolean isLowerBoundInclusive()Returns whether the min version is inclusive.- Returns:
trueif the min version is inclusive,falseotherwise
-
isUpperBoundInclusive
public boolean isUpperBoundInclusive()Returns whether the max version is inclusive.- Returns:
trueif the max version is inclusive,falseotherwise
-
isVersionRange
Checks if a string is a valid version range.- Parameters:
s- the string to check- Returns:
trueif the string is a valid version range,falseotherwise
-
valueOf
Parses a version range string into a Range object.- Parameters:
s- the version range string- Returns:
- the Range object
-
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. -
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 withObjects::equals(Object,Object). -
lowerBound
Returns the value of thelowerBoundrecord component.- Returns:
- the value of the
lowerBoundrecord component
-
minVersion
Returns the value of theminVersionrecord component.- Returns:
- the value of the
minVersionrecord component
-
maxVersion
Returns the value of themaxVersionrecord component.- Returns:
- the value of the
maxVersionrecord component
-
upperBound
Returns the value of theupperBoundrecord component.- Returns:
- the value of the
upperBoundrecord component
-