Struct DescriptorId
An unique identifier for an Issue Descriptor. IDs must have exactly 3 upper case characters, followed by 4 digits.
Implements
Inherited Members
Namespace: Unity.ProjectAuditor .Editor
Assembly: Unity.ProjectAuditor.Editor.dll
Syntax
[Serializable]
public struct DescriptorId : IEquatable<DescriptorId>
Remarks
Report
Constructors
DescriptorId(string)
Constructor
Declaration
public DescriptorId(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | String representing a valid and unique Descriptor ID. IDs must have exactly 3 upper case characters, followed by 4 digits. |
Methods
AsInt()
Get the hashed integer representation of the ID
Declaration
public int AsInt()
Returns
Type | Description |
---|---|
int | The ID as an int |
AsString()
Get the string representation of the ID
Declaration
public string AsString()
Returns
Type | Description |
---|---|
string | The ID as a string |
Equals(string)
Checks whether two DescriptorIDs contain the same ID.
Declaration
public bool Equals(string other)
Parameters
Type | Name | Description |
---|---|---|
string | other | A string representing a descriptor ID to compare to. |
Returns
Type | Description |
---|---|
bool | True if the descriptors are the same, false if they are different. |
Equals(DescriptorId)
Checks whether two DescriptorIDs contain the same ID.
Declaration
public bool Equals(DescriptorId other)
Parameters
Type | Name | Description |
---|---|---|
Descriptor |
other | A DescriptorId to compare to. |
Returns
Type | Description |
---|---|
bool | True if the descriptors are the same, false if they are different. |
GetDescriptor()
Get the Descriptor which corresponds to this ID.
Declaration
public Descriptor GetDescriptor()
Returns
Type | Description |
---|---|
Descriptor | The Descriptor which corresponds to this ID. If the ID is invalid, throws an exception. |
IsValid()
Checks whether the ID has been successfully constructed from a correctly-formatted string.
Declaration
public bool IsValid()
Returns
Type | Description |
---|---|
bool | True if the ID is valid |
ToString()
Returns the string representation of the ID
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The DescriptorId in string form. |
Overrides
Operators
implicit operator DescriptorId(string)
Implicit conversion of string to DescriptorId.
Declaration
public static implicit operator DescriptorId(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | A string to convert |
Returns
Type | Description |
---|---|
Descriptor |
A DescriptorId constructed using the string ID |
implicit operator int(DescriptorId)
Implicit conversion of DescriptorId to int.
Declaration
public static implicit operator int(DescriptorId d)
Parameters
Type | Name | Description |
---|---|---|
Descriptor |
d | A DescriptorId to convert |
Returns
Type | Description |
---|---|
int | The integer hash of the ID |
implicit operator string(DescriptorId)
Implicit conversion of DescriptorId to string.
Declaration
public static implicit operator string(DescriptorId d)
Parameters
Type | Name | Description |
---|---|---|
Descriptor |
d | A DescriptorId to convert |
Returns
Type | Description |
---|---|
string | A string representation of the ID |