Package ai.djl.repository
Class VersionRange
java.lang.Object
ai.djl.repository.VersionRange
A
VersionRange
is a set of Restriction
s that match some Version
s.
A VersionRange
should be constructed using parse(String)
. The
format used by the version ranges matches the maven
version range syntax.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if the artifact's version falls within this range.boolean
Returns true if a version falls within this range.Returns the recommended version in the range.List<ai.djl.repository.Restriction>
Returns the restrictions that compose the range.Filters the provided artifacts to those that match the version range.static VersionRange
Creates a new version range from a string version range.toString()
-
Method Details
-
getRecommendedVersion
Returns the recommended version in the range.- Returns:
- the recommended version in the range
-
getRestrictions
Returns the restrictions that compose the range.- Returns:
- the restrictions that compose the range
-
parse
Creates a new version range from a string version range.- Parameters:
spec
- the string version range- Returns:
- the
VersionRange
-
matches
Filters the provided artifacts to those that match the version range.- Parameters:
artifacts
- the artifacts to filter- Returns:
- the filtered artifacts
-
contains
Returns true if a version falls within this range.- Parameters:
version
- the version to test- Returns:
- true if the version falls within this range
-
contains
Returns true if the artifact's version falls within this range.- Parameters:
artifact
- the artifact to test- Returns:
- true if the artifact's version falls within this range
-
toString
-