SemanticVersionPreReleaseTag Class

Summary

Represents the pre-release label and optional numeric identifier of a semantic version (e.g. beta.1).
Namespace
GitVersion
Interfaces
Base Types
  • IFormattable
graph BT Type-->Base0["IFormattable"] Type-.->Interface0["IComparable<SemanticVersionPreReleaseTag>"] Type-.->Interface1["IEquatable<SemanticVersionPreReleaseTag>"] Type["SemanticVersionPreReleaseTag"] class Type type-node

Syntax

public sealed class SemanticVersionPreReleaseTag : IFormattable, 
    IComparable<SemanticVersionPreReleaseTag>, IEquatable<SemanticVersionPreReleaseTag>

Constructors

Name Summary
SemanticVersionPreReleaseTag() Initializes an empty pre-release tag.
SemanticVersionPreReleaseTag(SemanticVersionPreReleaseTag) Initializes a new pre-release tag as a copy of preReleaseTag.
SemanticVersionPreReleaseTag(string, long?, bool) Initializes a new pre-release tag with the given name, number, and promotion flag.

Fields

Name Constant Value Summary
Empty
An empty pre-release tag with no name and no number.
static

Properties

Name Value Summary
Name string
Gets or initializes the pre-release label (e.g. beta).
Number long?
Gets or initializes the numeric identifier appended after the label (e.g. the 1 in beta.1).
PromoteTagEvenIfNameIsEmpty bool
Gets or initializes a value indicating whether the tag should be promoted even when Name is empty.

Methods

Name Value Summary
CompareTo(SemanticVersionPreReleaseTag) int
Compares this tag to other by name and number.
Equals(object) bool
Returns true when obj is a SemanticVersionPreReleaseTag equal to this instance.
Equals(SemanticVersionPreReleaseTag) bool
Returns true when this tag is equal to other by name and number.
GetHashCode() int
Returns a hash code based on the tag name and number.
HasTag() bool
Returns true when this tag has a non-empty name or a number with the promotion flag set.
Parse(string) SemanticVersionPreReleaseTag
Parses a pre-release tag string, returning Empty when the input is null or empty.
static
ToString() string
Returns the default SemVer 2.0 formatted tag string (e.g. beta.1).
ToString(string, IFormatProvider?) string
Default formats:

t - SemVer 2.0 formatted tag [beta.1]

ToString(string) string
Returns a string representation using the given format specifier.

Operators

Name Value Summary
implicit operator SemanticVersionPreReleaseTag(string) SemanticVersionPreReleaseTag
implicit operator string(SemanticVersionPreReleaseTag) string
operator !=(SemanticVersionPreReleaseTag, SemanticVersionPreReleaseTag) bool
operator <(SemanticVersionPreReleaseTag, SemanticVersionPreReleaseTag) bool
operator <=(SemanticVersionPreReleaseTag, SemanticVersionPreReleaseTag) bool
operator ==(SemanticVersionPreReleaseTag, SemanticVersionPreReleaseTag) bool
operator >(SemanticVersionPreReleaseTag, SemanticVersionPreReleaseTag) bool
operator >=(SemanticVersionPreReleaseTag, SemanticVersionPreReleaseTag) bool

Extension Methods

Name Value Summary
NotNull<SemanticVersionPreReleaseTag>(string) T
Throws ArgumentNullException when value is null; otherwise returns the value.
GitHub