Package org.opensearch.semver
Class SemverRange
java.lang.Object
org.opensearch.semver.SemverRange
- All Implemented Interfaces:
ToXContent,ToXContentFragment
Represents a single semver range that allows for specifying which
org.opensearch.Versions satisfy the range.
It is composed of a range version and a range operator. Following are the supported operators:
- '=' Requires exact match with the range version. For example, =1.2.3 range would match only 1.2.3
- '~' Allows for patch version variability starting from the range version. For example, ~1.2.3 range would match versions greater than or equal to 1.2.3 but less than 1.3.0
- '^' Allows for patch and minor version variability starting from the range version. For example, ^1.2.3 range would match versions greater than or equal to 1.2.3 but less than 2.0.0
- Opensearch.api:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params -
Field Summary
Fields inherited from interface org.opensearch.core.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic SemverRangefromString(String range) Constructs aSemverRangefrom its string representation.Return the range operator for this range.Return the version for this range.inthashCode()booleanisSatisfiedBy(String versionToEvaluate) Check if range is satisfied by given version string.booleanisSatisfiedBy(Version versionToEvaluate) Check if range is satisfied by given version.toString()toXContent(XContentBuilder builder, ToXContent.Params params) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opensearch.core.xcontent.ToXContentFragment
isFragment
-
Constructor Details
-
SemverRange
-
-
Method Details
-
fromString
Constructs aSemverRangefrom its string representation.- Parameters:
range- given range- Returns:
- a
SemverRange
-
getRangeOperator
Return the range operator for this range.- Returns:
- range operator
-
getRangeVersion
Return the version for this range.- Returns:
- the range version
-
isSatisfiedBy
Check if range is satisfied by given version string.- Parameters:
versionToEvaluate- version to check- Returns:
trueif range is satisfied by version,falseotherwise
-
isSatisfiedBy
Check if range is satisfied by given version.- Parameters:
versionToEvaluate- version to check- Returns:
trueif range is satisfied by version,falseotherwise- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-