# DescriptorId

> An unique identifier for an Issue Descriptor. IDs must have exactly 3 upper case characters, followed by 4 digits.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.ProjectAuditor.Editor](/engine/6000.6/script-reference/unity/projectauditor/editor.md)
* **Assembly:** UnityEditor
* **Implements:** [IEquatable\<DescriptorId>](https://learn.microsoft.com/dotnet/api/system.iequatable-1), [ISerializationCallbackReceiver](/engine/6000.6/script-reference/unityengine/iserializationcallbackreceiver.md)

```csharp
public struct DescriptorId : IEquatable<DescriptorId>, ISerializationCallbackReceiver
```

## Remarks

[ReportItem](/engine/6000.6/script-reference/unity/projectauditor/editor/reportitem.md)s representing Issues (as opposed to Insights: purely informational ProjectIssues) all contain a DescriptorId. The DescriptorId is used to reference the information about a particular issue (for example, "PAC2002" is the code for "Object allocation"), and the ReportItem simply contains the file:line location in code where the allocation occurs and a "PAC2002" DescriptorId. The descriptor can generally be treated as a string, but for efficient descriptor lookups the string is converted to an int in the struct's constructor.

## Constructors

| Constructor                                                                                                     | Description |
| --------------------------------------------------------------------------------------------------------------- | ----------- |
| [DescriptorId(System.String)](/engine/6000.6/script-reference/unity/projectauditor/editor/descriptorid/ctor.md) | Constructor |

## Methods

| Method                                                                                                               | Description                                                                                |
| -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [AsInt](/engine/6000.6/script-reference/unity/projectauditor/editor/descriptorid/asint.md)                           | Get the hashed integer representation of the ID                                            |
| [AsString](/engine/6000.6/script-reference/unity/projectauditor/editor/descriptorid/asstring.md)                     | Get the string representation of the ID                                                    |
| [Equals](/engine/6000.6/script-reference/unity/projectauditor/editor/descriptorid/equals.md)                         | Checks whether two DescriptorIDs contain the same ID.                                      |
| [GetDescriptor](/engine/6000.6/script-reference/unity/projectauditor/editor/descriptorid/getdescriptor.md)           | Get the Descriptor which corresponds to this ID.                                           |
| [IsValid](/engine/6000.6/script-reference/unity/projectauditor/editor/descriptorid/isvalid.md)                       | Checks whether the ID has been successfully constructed from a correctly-formatted string. |
| [OnAfterDeserialize](/engine/6000.6/script-reference/unity/projectauditor/editor/descriptorid/onafterdeserialize.md) | Unity calls this method automatically after deserialization.                               |
| [OnBeforeSerialize](/engine/6000.6/script-reference/unity/projectauditor/editor/descriptorid/onbeforeserialize.md)   | Unity calls this method automatically before serialization.                                |
| [ToString](/engine/6000.6/script-reference/unity/projectauditor/editor/descriptorid/tostring.md)                     | Returns the string representation of the ID                                                |

## Operators

| Operator                                                                                                | Description                                    |
| ------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| [DescriptorId](/engine/6000.6/script-reference/unity/projectauditor/editor/descriptorid/op-implicit.md) | Implicit conversion of string to DescriptorId. |
| [int](/engine/6000.6/script-reference/unity/projectauditor/editor/descriptorid/op-implicit.md)          | Implicit conversion of DescriptorId to int.    |
| [string](/engine/6000.6/script-reference/unity/projectauditor/editor/descriptorid/op-implicit.md)       | Implicit conversion of DescriptorId to string. |
