public class Requirement extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Requirement.RequirementOperator
The operators that can be used in a requirement.
|
| Modifier and Type | Field and Description |
|---|---|
protected Requirement.RequirementOperator |
op |
protected Range |
range |
protected Requirement |
req1 |
protected Requirement |
req2 |
| Modifier | Constructor and Description |
|---|---|
protected |
Requirement(Range range,
Requirement req1,
Requirement.RequirementOperator op,
Requirement req2)
Builds a requirement.
|
| Modifier and Type | Method and Description |
|---|---|
static Requirement |
buildCocoapods(String requirement)
Builds a requirement following the rules of Cocoapods.
|
static Requirement |
buildIvy(String requirement)
Builds a requirement following the rules of Ivy.
|
static Requirement |
buildLoose(Semver requirement)
Builds a loose requirement (will test that the version is equivalent to the requirement)
|
static Requirement |
buildLoose(String requirement) |
static Requirement |
buildNPM(String requirement)
Builds a requirement following the rules of NPM.
|
static Requirement |
buildStrict(Semver requirement)
Builds a strict requirement (will test that the version is equivalent to the requirement)
|
static Requirement |
buildStrict(String requirement) |
protected static Requirement |
caretRequirement(String version,
Semver.SemverType type)
Allows changes that do not modify the left-most non-zero digit in the [major, minor, patch] tuple.
|
protected static Requirement |
hyphenRequirement(String lowerVersion,
String upperVersion,
Semver.SemverType type)
Creates a requirement that satisfies "x1.y1.z1 - x2.y2.z2".
|
boolean |
isSatisfiedBy(Semver version)
Checks if the requirement is satisfied by a version.
|
boolean |
isSatisfiedBy(String version) |
protected static Requirement |
tildeRequirement(String version,
Semver.SemverType type)
Allows patch-level changes if a minor version is specified on the comparator.
|
String |
toString() |
protected final Range range
protected final Requirement req1
protected final Requirement.RequirementOperator op
protected final Requirement req2
protected Requirement(Range range, Requirement req1, Requirement.RequirementOperator op, Requirement req2)
public static Requirement buildStrict(String requirement)
buildStrict(Semver)public static Requirement buildStrict(Semver requirement)
requirement - the version of the requirementpublic static Requirement buildLoose(String requirement)
buildLoose(Semver)public static Requirement buildLoose(Semver requirement)
requirement - the version of the requirementpublic static Requirement buildNPM(String requirement)
requirement - the requirement as a stringpublic static Requirement buildCocoapods(String requirement)
requirement - the requirement as a stringpublic static Requirement buildIvy(String requirement)
requirement - the requirement as a stringprotected static Requirement tildeRequirement(String version, Semver.SemverType type)
protected static Requirement caretRequirement(String version, Semver.SemverType type)
protected static Requirement hyphenRequirement(String lowerVersion, String upperVersion, Semver.SemverType type)
public boolean isSatisfiedBy(String version)
isSatisfiedBy(Semver)public boolean isSatisfiedBy(Semver version)
version - the version that will be checkedCopyright © 2017. All rights reserved.