Class PrereleaseIdentifier
An individual prerelease identifier for a semantic version.
Inheritance
System.Object
PrereleaseIdentifier
Implements
System.IComparable
Assembly: Semver.dll
Syntax
public sealed class PrereleaseIdentifier : ValueType
Constructors
PrereleaseIdentifier(BigInteger)
Declaration
public PrereleaseIdentifier(BigInteger value)
Parameters
| Type |
Name |
Description |
| System.Numerics.BigInteger |
value |
The non-negative value of this identifier. |
Exceptions
| Type |
Condition |
| System.ArgumentOutOfRangeException |
The value is negative. |
PrereleaseIdentifier(String, Boolean)
Declaration
public PrereleaseIdentifier(string value, bool allowLeadingZeros = false)
Parameters
| Type |
Name |
Description |
| System.String |
value |
The string value of this prerelease identifier. |
| System.Boolean |
allowLeadingZeros |
Whether to allow leading zeros in the value
parameter. If true, leading zeros will be allowed on numeric identifiers
but will be removed. |
Exceptions
| Type |
Condition |
| System.ArgumentNullException |
The value is null. |
| System.ArgumentException |
The value is empty or contains invalid characters
(i.e. characters that are not ASCII alphanumerics or hyphens) or has leading zeros for
a numeric identifier when allowLeadingZeros is false. |
Properties
NumericValue
The numeric value of the prerelease identifier if it is a numeric identifier, otherwise
null.
Declaration
public Nullable<BigInteger> NumericValue { get; }
Property Value
| Type |
Description |
| System.Nullable<System.Numerics.BigInteger> |
The numeric value of the prerelease identifier if it is a numeric identifier,
otherwise null. |
Value
The string value of the prerelease identifier even if it is a numeric identifier.
Declaration
public string Value { get; }
Property Value
| Type |
Description |
| System.String |
The string value of this prerelease identifier even if it is a numeric identifier
or null if this is a default PrereleaseIdentifier. |
Methods
CompareTo(PrereleaseIdentifier)
Compares two identifiers and indicates whether this instance precedes, follows, or is
equal to the other in precedence order.
Declaration
public int CompareTo(PrereleaseIdentifier value)
Parameters
Returns
| Type |
Description |
| System.Int32 |
An integer that indicates whether this instance precedes, follows, or is equal to
value in precedence order.
| Value | Condition |
|---|
| -1 | This instance precedes value. | | 0 | This instance is equal to value. | | 1 | This instance follows value. |
|
CompareTo(Object)
Compares this identifier to an System.Object and indicates whether this instance
precedes, follows, or is equal to the object in precedence order.
Declaration
public int CompareTo(object value)
Parameters
| Type |
Name |
Description |
| System.Object |
value |
|
Returns
| Type |
Description |
| System.Int32 |
An integer that indicates whether this instance precedes, follows, or is equal to
value in precedence order.
| Value | Condition |
|---|
| -1 | This instance precedes value. | | 0 | This instance is equal to value. | | 1 | This instance follows value or value
is null. |
|
Exceptions
Equals(PrereleaseIdentifier)
Determines whether two identifiers are equal.
Declaration
public bool Equals(PrereleaseIdentifier value)
Parameters
Returns
| Type |
Description |
| System.Boolean |
true if value is equal to this identifier;
otherwise false. |
Equals(Object)
Determines whether the given object is equal to this identifier.
Declaration
public override bool Equals(object value)
Parameters
| Type |
Name |
Description |
| System.Object |
value |
|
Returns
| Type |
Description |
| System.Boolean |
true if value is equal to this identifier;
otherwise false. |
GetHashCode()
Gets a hash code for this identifier.
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| System.Int32 |
A hash code for this identifier. |
ToString()
Converts this identifier into an equivalent string value.
Declaration
public override string ToString()
Returns
| Type |
Description |
| System.String |
The string value of this identifier or null if this is
a default PrereleaseIdentifier |
Operators
Equality(PrereleaseIdentifier, PrereleaseIdentifier)
Determines whether two identifiers are equal.
Declaration
public static bool operator ==(PrereleaseIdentifier left, PrereleaseIdentifier right)
Parameters
Returns
| Type |
Description |
| System.Boolean |
true if the value of left is the same as
the value of right; otherwise false. |
Implicit(PrereleaseIdentifier to String)
Converts this identifier into an equivalent string value.
Declaration
public static implicit operator string (PrereleaseIdentifier prereleaseIdentifier)
Parameters
Returns
| Type |
Description |
| System.String |
The string value of this identifier or null if this is
a default PrereleaseIdentifier |
Inequality(PrereleaseIdentifier, PrereleaseIdentifier)
Determines whether two identifiers are not equal.
Declaration
public static bool operator !=(PrereleaseIdentifier left, PrereleaseIdentifier right)
Parameters
Returns
| Type |
Description |
| System.Boolean |
true if the value of left is different
from the value of right; otherwise false. |
Implements
System.IEquatable<>
System.IComparable<>
System.IComparable