BaseVersion Class

Summary

Represents a resolved base version consisting of an operand (the discovered version) and an optional operator (the increment to apply).
Assembly
GitVersion.Core.dll
Namespace
GitVersion.VersionCalculation
Interfaces
Base Types
  • Object
graph BT Type-->Base0["Object"] Type-.->Interface0["IBaseVersion"] click Interface0 "/api/GitVersion.VersionCalculation/IBaseVersion" Type-.->Interface1["IBaseVersionIncrement"] click Interface1 "/api/GitVersion.VersionCalculation/IBaseVersionIncrement" Type-.->Interface2["IEquatable<BaseVersion>"] Type["BaseVersion"] class Type type-node

Syntax

public sealed class BaseVersion : IBaseVersion, IBaseVersionIncrement, IEquatable<BaseVersion>

Attributes

Type Description
NullableContextAttribute
NullableAttribute

Constructors

Name Summary
BaseVersion() Initializes an empty base version.
BaseVersion(BaseVersionOperand) Represents a resolved base version consisting of an operand (the discovered version) and an optional operator (the increment to apply).
BaseVersion(string, SemanticVersion, ICommit) Initializes a base version from a source description, semantic version, and optional source commit.

Properties

Name Value Summary
BaseVersionSource ICommit
Gets the commit that is the source of this base version.
Increment VersionField
Gets the version field that will be incremented, or None when no increment is needed.
SemanticVersion SemanticVersion
Gets the base semantic version before any increment is applied.
ShouldIncrement bool
Gets a value indicating whether this base version has a pending increment operator.
Source string
Gets the human-readable description of the source that produced this base version.

Methods

Name Value Summary
Deconstruct(BaseVersionOperand) void
Equals(BaseVersion) bool
Equals(object) bool
get_Operand() BaseVersionOperand
get_Operator() BaseVersionOperator
GetHashCode() int
GetIncrementedVersion() SemanticVersion
Returns the semantic version after applying the operator increment, or the base version when no increment is needed.
set_Operand()
set_Operator()
ToString() string
Returns a human-readable description of this base version including source, version, increment, and commit anchor.

Operators

Name Value Summary
operator !=(BaseVersion, BaseVersion) bool
operator ==(BaseVersion, BaseVersion) bool

Extension Methods

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