VersionConstraint class abstract
A VersionConstraint is a predicate that can determine whether a given version is valid or not.
For example, a ">= 2.0.0" constraint allows any version that is "2.0.0" or greater. Version objects themselves implement this to match a specific version.
Constructors
- VersionConstraint.compatibleWith(Version version)
-
Creates a version constraint which allows all versions that are
backward compatible with
version
.factory -
VersionConstraint.intersection(Iterable<
VersionConstraint> constraints) -
Creates a new version constraint that is the intersection of
constraints
.factory - VersionConstraint.parse(String text)
-
Parses a version constraint.
factory
-
VersionConstraint.unionOf(Iterable<
VersionConstraint> constraints) -
Creates a new version constraint that is the union of
constraints
.factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAny → bool
-
Returns
true
if this constraint allows all versions.no setter - isEmpty → bool
-
Returns
true
if this constraint allows no versions.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
allows(
Version version) → bool -
Returns
true
if this constraint allowsversion
. -
allowsAll(
VersionConstraint other) → bool -
Returns
true
if this constraint allows all the versions thatother
allows. -
allowsAny(
VersionConstraint other) → bool -
Returns
true
if this constraint allows any of the versions thatother
allows. -
difference(
VersionConstraint other) → VersionConstraint -
Returns a VersionConstraint that allows Versions allowed by this but
not
other
. -
intersect(
VersionConstraint other) → VersionConstraint -
Returns a VersionConstraint that only allows Versions allowed by both
this and
other
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
union(
VersionConstraint other) → VersionConstraint -
Returns a VersionConstraint that allows Versions allowed by either
this or
other
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- any ↔ VersionConstraint
-
A VersionConstraint that allows all versions.
getter/setter pair
- empty ↔ VersionConstraint
-
A VersionConstraint that allows no versions -- the empty set.
getter/setter pair