Struct VersionPart
- Namespace
- ZeroInstall.Model
- Assembly
- ZeroInstall.Model.dll
Represents a part of a ImplementationVersion containing nothing, a VersionModifier, a DottedList or both.
[Serializable]
public readonly struct VersionPart : IEquatable<VersionPart>, IComparable<VersionPart>
- Implements
- Inherited Members
Constructors
VersionPart(VersionModifier, VersionDottedList)
Creates a new version part.
public VersionPart(VersionModifier modifier = VersionModifier.None, VersionDottedList dottedList = default)
Parameters
modifier
VersionModifierThe optional modifier prefix.
dottedList
VersionDottedListThe dotted list part.
Properties
DottedList
The dotted list part.
public VersionDottedList DottedList { get; }
Property Value
Modifier
The optional modifier prefix.
public VersionModifier Modifier { get; }
Property Value
Methods
CompareTo(VersionPart)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(VersionPart other)
Parameters
other
VersionPartAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes other
in the sort order.Zero This instance occurs in the same position in the sort order as other
.Greater than zero This instance follows other
in the sort order.
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
Equals(VersionPart)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(VersionPart other)
Parameters
other
VersionPartAn object to compare with this object.
Returns
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Parse(string)
Parses a string into a version part.
public static VersionPart Parse(string value)
Parameters
value
string
Returns
Exceptions
- FormatException
value
is not a valid version part.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(VersionPart, VersionPart)
public static bool operator ==(VersionPart left, VersionPart right)
Parameters
left
VersionPartright
VersionPart
Returns
operator >(VersionPart, VersionPart)
public static bool operator >(VersionPart left, VersionPart right)
Parameters
left
VersionPartright
VersionPart
Returns
operator >=(VersionPart, VersionPart)
public static bool operator >=(VersionPart left, VersionPart right)
Parameters
left
VersionPartright
VersionPart
Returns
operator !=(VersionPart, VersionPart)
public static bool operator !=(VersionPart left, VersionPart right)
Parameters
left
VersionPartright
VersionPart
Returns
operator <(VersionPart, VersionPart)
public static bool operator <(VersionPart left, VersionPart right)
Parameters
left
VersionPartright
VersionPart
Returns
operator <=(VersionPart, VersionPart)
public static bool operator <=(VersionPart left, VersionPart right)
Parameters
left
VersionPartright
VersionPart