Package de.mnl.osgi.bnd.maven
Class MavenVersionRange
- java.lang.Object
-
- de.mnl.osgi.bnd.maven.MavenVersionSpecification
-
- de.mnl.osgi.bnd.maven.MavenVersionRange
-
public class MavenVersionRange extends MavenVersionSpecification
Provides a representation of a maven version range. The implementation is a small wrapper aroundVersionRange
.Because
VersionRange
has only a private constructor and cannot be extended, the wrapper delegates to an instance ofVersionRange
.
-
-
Field Summary
Fields Modifier and Type Field Description static MavenVersionRange
ALL
static MavenVersionRange
NONE
-
Constructor Summary
Constructors Constructor Description MavenVersionRange(String range)
Instantiates a new maven version range from the given representation.MavenVersionRange(org.apache.maven.artifact.versioning.VersionRange range)
Instantiates a new maven version range from the given range.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MavenVersionRange
complement()
Returns the complementary version rang.boolean
equals(Object obj)
int
hashCode()
boolean
includes(MavenVersionSpecification mavenVersion)
Checks if this version range includes the specified version or range.static boolean
isRange(String version)
Deprecated.UseMavenVersionSpecification.isRange(String)
insteadstatic MavenVersionRange
parseRange(String version)
Creates a new maven version range from the given representation.MavenVersionRange
restrict(MavenVersionRange restriction)
Creates and returns a new VersionRange that is a restriction of this version range and the specified version range.String
toString()
org.apache.maven.artifact.versioning.VersionRange
versionRange()
Returns the version range that this instance delegates to.-
Methods inherited from class de.mnl.osgi.bnd.maven.MavenVersionSpecification
from
-
-
-
-
Field Detail
-
ALL
public static final MavenVersionRange ALL
-
NONE
public static final MavenVersionRange NONE
-
-
Constructor Detail
-
MavenVersionRange
public MavenVersionRange(org.apache.maven.artifact.versioning.VersionRange range)
Instantiates a new maven version range from the given range.- Parameters:
range
- the range
-
MavenVersionRange
public MavenVersionRange(String range)
Instantiates a new maven version range from the given representation. Ifversion
is null it is considered to be the "all inclusive range" ("[0,)").- Parameters:
range
- the range
-
-
Method Detail
-
versionRange
public org.apache.maven.artifact.versioning.VersionRange versionRange()
Returns the version range that this instance delegates to.- Returns:
- the org.apache.maven.artifact.versioning. version range
-
complement
public MavenVersionRange complement()
Returns the complementary version rang.- Returns:
- the maven version range
-
includes
public boolean includes(MavenVersionSpecification mavenVersion)
Checks if this version range includes the specified version or range. A range is included if it is fully included.- Parameters:
mavenVersion
- the maven version- Returns:
- the result
-
restrict
public MavenVersionRange restrict(MavenVersionRange restriction)
Creates and returns a new VersionRange that is a restriction of this version range and the specified version range.- Parameters:
restriction
- the restriction- Returns:
- the maven version range
- See Also:
VersionRange.restrict(org.apache.maven.artifact.versioning.VersionRange)
-
parseRange
public static MavenVersionRange parseRange(String version)
Creates a new maven version range from the given representation.- Parameters:
version
- the string representation- Returns:
- the maven version range
-
isRange
@Deprecated public static boolean isRange(String version)
Deprecated.UseMavenVersionSpecification.isRange(String)
insteadChecks if is the provided version representation is a range. Ifversion
is null it is considered to be the "all inclusive range" ("[0,)").- Parameters:
version
- the version- Returns:
- true, if is range
-
-