Class UnbrokenSemVersionRange
Inheritance
System.Object
UnbrokenSemVersionRange
Assembly: Semver.dll
Syntax
public sealed class UnbrokenSemVersionRange : Object
Properties
All
The range that contains both all release and prerelease versions.
Declaration
public static UnbrokenSemVersionRange All { get; }
Property Value
AllRelease
The range that contains all release versions but no prerelease versions.
Declaration
public static UnbrokenSemVersionRange AllRelease { get; }
Property Value
Empty
A standard representation for the empty range that contains no versions.
Declaration
public static UnbrokenSemVersionRange Empty { get; }
Property Value
End
The end, right limit, or maximum of this range. Can be null.
Declaration
public SemVersion End { get; }
Property Value
| Type |
Description |
| SemVersion |
The end, right limit, or maximum of this range. Can be null. |
EndInclusive
Whether this range includes the
End value.
Declaration
public bool EndInclusive { get; }
Property Value
| Type |
Description |
| System.Boolean |
Whether this range includes the End value. |
IncludeAllPrerelease
Whether this range includes all prerelease versions between
Start and
End. If
IncludeAllPrerelease is
false then
prerelease versions matching the major, minor, and patch version of the
Start
or
End will be included only if that end is a prerelease version.
Declaration
public bool IncludeAllPrerelease { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
Start
The start, left limit, or minimum of this range. Can be null.
Declaration
public SemVersion Start { get; }
Property Value
| Type |
Description |
| SemVersion |
The start or left end of this range. Can be null. |
StartInclusive
Whether this range includes the
Start value.
Declaration
public bool StartInclusive { get; }
Property Value
| Type |
Description |
| System.Boolean |
Whether this range includes the Start value. |
Methods
AtLeast(SemVersion, Boolean)
Construct a range containing versions equal to or greater than the given version.
Declaration
public static UnbrokenSemVersionRange AtLeast(SemVersion version, bool includeAllPrerelease = false)
Parameters
| Type |
Name |
Description |
| SemVersion |
version |
The range will contain all versions greater than or equal to this. |
| System.Boolean |
includeAllPrerelease |
Include all prerelease versions in the range rather
than just those matching the given version if it is prerelease. |
Returns
AtMost(SemVersion, Boolean)
Construct a range containing versions equal to or less than the given version.
Declaration
public static UnbrokenSemVersionRange AtMost(SemVersion version, bool includeAllPrerelease = false)
Parameters
| Type |
Name |
Description |
| SemVersion |
version |
The range will contain all versions less than or equal to this. |
| System.Boolean |
includeAllPrerelease |
Include all prerelease versions in the range rather
than just those matching the given version if it is prerelease. |
Returns
Contains(SemVersion)
Determine whether this range contains the given version.
Declaration
public bool Contains(SemVersion version)
Parameters
| Type |
Name |
Description |
| SemVersion |
version |
The version to test against the range. |
Returns
| Type |
Description |
| System.Boolean |
true if the version is contained in the range,
otherwise false. |
Equals(SemVersion)
Construct a range containing only a single version.
Declaration
public static UnbrokenSemVersionRange Equals(SemVersion version)
Parameters
| Type |
Name |
Description |
| SemVersion |
version |
The version the range should contain. |
Returns
Equals(UnbrokenSemVersionRange)
Determines whether two version ranges are equal.
Declaration
public bool Equals(UnbrokenSemVersionRange other)
Parameters
Returns
| Type |
Description |
| System.Boolean |
true if other is equal to this range;
otherwise false. |
Equals(Object)
Determines whether the given object is equal to this range.
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| System.Object |
obj |
|
Returns
| Type |
Description |
| System.Boolean |
true if obj is equal to this range;
otherwise false. |
Exclusive(SemVersion, SemVersion, Boolean)
Construct a range containing all versions between the given versions excluding those versions.
Declaration
public static UnbrokenSemVersionRange Exclusive(SemVersion start, SemVersion end, bool includeAllPrerelease = false)
Parameters
| Type |
Name |
Description |
| SemVersion |
start |
The range will contain only versions greater than this. |
| SemVersion |
end |
The range will contain only versions less than this. |
| System.Boolean |
includeAllPrerelease |
Include all prerelease versions in the range rather
than just those matching the given versions if they are prerelease. |
Returns
| Type |
Description |
| UnbrokenSemVersionRange |
A range containing versions between the given versions including the end but
not the start. |
GetHashCode()
Gets a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| System.Int32 |
A hash code for this instance, suitable for use in hashing algorithms
and data structures like a hash table.
|
GreaterThan(SemVersion, Boolean)
Construct a range containing versions greater than the given version.
Declaration
public static UnbrokenSemVersionRange GreaterThan(SemVersion version, bool includeAllPrerelease = false)
Parameters
| Type |
Name |
Description |
| SemVersion |
version |
The range will contain all versions greater than this. |
| System.Boolean |
includeAllPrerelease |
Include all prerelease versions in the range rather
than just those matching the given version if it is prerelease. |
Returns
Inclusive(SemVersion, SemVersion, Boolean)
Construct a range containing all versions between the given versions including those versions.
Declaration
public static UnbrokenSemVersionRange Inclusive(SemVersion start, SemVersion end, bool includeAllPrerelease = false)
Parameters
| Type |
Name |
Description |
| SemVersion |
start |
The range will contain only versions greater than or equal to this. |
| SemVersion |
end |
The range will contain only versions less than or equal to this. |
| System.Boolean |
includeAllPrerelease |
Include all prerelease versions in the range rather
than just those matching the given versions if they are prerelease. |
Returns
| Type |
Description |
| UnbrokenSemVersionRange |
A range containing versions between the given versions including those versions. |
InclusiveOfEnd(SemVersion, SemVersion, Boolean)
Construct a range containing all versions between the given versions including the end but
not the start.
Declaration
public static UnbrokenSemVersionRange InclusiveOfEnd(SemVersion start, SemVersion end, bool includeAllPrerelease = false)
Parameters
| Type |
Name |
Description |
| SemVersion |
start |
The range will contain only versions greater than this. |
| SemVersion |
end |
The range will contain only versions less than or equal to this. |
| System.Boolean |
includeAllPrerelease |
Include all prerelease versions in the range rather
than just those matching the given versions if they are prerelease. |
Returns
| Type |
Description |
| UnbrokenSemVersionRange |
A range containing versions between the given versions including the end but
not the start. |
InclusiveOfStart(SemVersion, SemVersion, Boolean)
Construct a range containing all versions between the given versions including the start
but not the end.
Declaration
public static UnbrokenSemVersionRange InclusiveOfStart(SemVersion start, SemVersion end, bool includeAllPrerelease = false)
Parameters
| Type |
Name |
Description |
| SemVersion |
start |
The range will contain only versions greater than or equal to this. |
| SemVersion |
end |
The range will contain only versions less than this. |
| System.Boolean |
includeAllPrerelease |
Include all prerelease versions in the range rather
than just those matching the given versions if they are prerelease. |
Returns
| Type |
Description |
| UnbrokenSemVersionRange |
A range containing versions between the given versions including the start but
not the end. |
LessThan(SemVersion, Boolean)
Construct a range containing versions less than the given version.
Declaration
public static UnbrokenSemVersionRange LessThan(SemVersion version, bool includeAllPrerelease = false)
Parameters
| Type |
Name |
Description |
| SemVersion |
version |
The range will contain all versions less than this. |
| System.Boolean |
includeAllPrerelease |
Include all prerelease versions in the range rather
than just those matching the given version if it is prerelease. |
Returns
ToString()
Declaration
public override string ToString()
Returns
Operators
Equality(UnbrokenSemVersionRange, UnbrokenSemVersionRange)
Determines whether two version ranges are equal.
Declaration
public static bool operator ==(UnbrokenSemVersionRange left, UnbrokenSemVersionRange right)
Parameters
Returns
| Type |
Description |
| System.Boolean |
true if the two values are equal, otherwise false. |
Implicit(UnbrokenSemVersionRange to Predicate<SemVersion>)
Convert this range into a predicate function indicating whether a version is contained
in the range.
Declaration
public static implicit operator Predicate<SemVersion>(UnbrokenSemVersionRange range)
Parameters
Returns
| Type |
Description |
| System.Predicate<SemVersion> |
A predicate that indicates whether a given version is contained in this range. |
Inequality(UnbrokenSemVersionRange, UnbrokenSemVersionRange)
Determines whether two version ranges are not equal. Due to the complexity of
ranges, it may be possible for two ranges to match the same set of versions but be
expressed in different ways and so not be equal.
Declaration
public static bool operator !=(UnbrokenSemVersionRange left, UnbrokenSemVersionRange right)
Parameters
Returns
| Type |
Description |
| System.Boolean |
true if the two ranges are not equal, otherwise false. |
Implements
System.IEquatable<>