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
trueif this constraint allows all versions.no setter - isEmpty → bool
-
Returns
trueif 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
trueif this constraint allowsversion. -
allowsAll(
VersionConstraint other) → bool -
Returns
trueif this constraint allows all the versions thatotherallows. -
allowsAny(
VersionConstraint other) → bool -
Returns
trueif this constraint allows any of the versions thatotherallows. -
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