Class SimpleRange
- java.lang.Object
-
- net.adoptopenjdk.icedteaweb.jnlp.version.SimpleRange
-
class SimpleRange extends java.lang.ObjectA simple-range is either a version-id, a version-id followed by a star (*) or a version-id followed by a plus sign (+). The star means prefix match, the plus sign means this version or greater.The syntax of version-strings is:
simple-range ::= version-id | version-id modifier modifier ::= "+" | "*"See JSR-56 Specification, Appendix A.
- See Also:
JNLPVersionPatterns
-
-
Field Summary
Fields Modifier and Type Field Description private VersionModifiermodifierprivate VersionIdversionId
-
Constructor Summary
Constructors Modifier Constructor Description privateSimpleRange(VersionId versionId, VersionModifier modifier)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(java.lang.String otherVersionId)Check if this simple-range contains the givenversionId.booleancontains(VersionId otherVersionId)Check if this simple-range contains the givenversionId.booleanequals(java.lang.Object otherSimpleRange)private static VersionModifierextractModifier(java.lang.String simpleRange)private static VersionIdextractVersionId(java.lang.String simpleRange)static SimpleRangefromString(java.lang.String simpleRange)Construct a simple-range by the givensimpleRange.(package private) VersionIdgetExactVersion()(package private) booleanhasGreaterThanOrEqualMatchModifier()(package private) booleanhasPrefixMatchModifier()(package private) booleanisEqualTo(SimpleRange otherSimpleRange)(package private) booleanisExactVersion()Checks whether this simple-range represents a single version-id without any postfix modifiers.java.lang.StringtoString()Provides a string representation of thisSimpleRange.
-
-
-
Field Detail
-
versionId
private final VersionId versionId
-
modifier
private final VersionModifier modifier
-
-
Constructor Detail
-
SimpleRange
private SimpleRange(VersionId versionId, VersionModifier modifier)
-
-
Method Detail
-
isExactVersion
boolean isExactVersion()
Checks whether this simple-range represents a single version-id without any postfix modifiers.- Returns:
trueif this simple-range does not have any modifiers,falseotherwise.
-
getExactVersion
VersionId getExactVersion()
- Returns:
- the exact version if this simple-range is one
- Throws:
java.lang.IllegalStateException- if this simple-range is not one
-
hasPrefixMatchModifier
boolean hasPrefixMatchModifier()
-
hasGreaterThanOrEqualMatchModifier
boolean hasGreaterThanOrEqualMatchModifier()
-
fromString
public static SimpleRange fromString(java.lang.String simpleRange)
Construct a simple-range by the givensimpleRange.- Parameters:
simpleRange- a simple-range- Returns:
- a SimpleRange
-
extractModifier
private static VersionModifier extractModifier(java.lang.String simpleRange)
-
extractVersionId
private static VersionId extractVersionId(java.lang.String simpleRange)
-
toString
public java.lang.String toString()
Provides a string representation of thisSimpleRange.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this simple-range
-
isEqualTo
boolean isEqualTo(SimpleRange otherSimpleRange)
-
equals
public boolean equals(java.lang.Object otherSimpleRange)
- Overrides:
equalsin classjava.lang.Object
-
contains
public boolean contains(java.lang.String otherVersionId)
Check if this simple-range contains the givenversionId.- Parameters:
otherVersionId- a version-id- Returns:
trueif this version-range containsversionId,falseotherwise.
-
contains
public boolean contains(VersionId otherVersionId)
Check if this simple-range contains the givenversionId.- Parameters:
otherVersionId- a version-id- Returns:
trueif this version-range containsversionId,falseotherwise.
-
-