final class GenericVersionConstraint extends java.lang.Object implements VersionConstraint
| Modifier and Type | Field and Description |
|---|---|
private VersionRange |
range |
private Version |
version |
| Constructor and Description |
|---|
GenericVersionConstraint(Version version)
Creates a version constraint from the specified version.
|
GenericVersionConstraint(VersionRange range)
Creates a version constraint from the specified version range.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsVersion(Version version)
Determines whether the specified version satisfies this constraint.
|
private static <T> boolean |
eq(T s1,
T s2) |
boolean |
equals(java.lang.Object obj) |
VersionRange |
getRange()
Gets the version range of this constraint.
|
Version |
getVersion()
Gets the version recommended by this constraint.
|
private static int |
hash(java.lang.Object obj) |
int |
hashCode() |
java.lang.String |
toString() |
private final VersionRange range
private final Version version
GenericVersionConstraint(VersionRange range)
range - The version range, must not be null.GenericVersionConstraint(Version version)
version - The version, must not be null.public VersionRange getRange()
VersionConstraintgetRange in interface VersionConstraintnull if none.public Version getVersion()
VersionConstraintgetVersion in interface VersionConstraintnull if none.public boolean containsVersion(Version version)
VersionConstraintcontainsVersion in interface VersionConstraintversion - The version to test, must not be null.true if the specified version satisfies this constraint, false otherwise.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectprivate static <T> boolean eq(T s1,
T s2)
public int hashCode()
hashCode in class java.lang.Objectprivate static int hash(java.lang.Object obj)