Struct AnnotationId
Represents a unique identifier for an annotation within the Collaboration SDK.
Implements
Inherited Members
Namespace: Unity.Cloud.Collaboration.Abstractions
Assembly: Unity.Cloud.Collaboration.dll
Syntax
public readonly struct AnnotationId : IEquatable<AnnotationId>
Remarks
The AnnotationId struct provides methods for creating, comparing, and manipulating annotation identifiers. It supports initialization using either a string or a Guid.
Constructors
AnnotationId(Guid)
Returns a AnnotationId using a Guid.
Declaration
public AnnotationId(Guid value)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | value | The guid representing the annotation identifier |
AnnotationId(string)
Returns a AnnotationId using a string.
Declaration
public AnnotationId(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The string representing the annotation identifier |
Methods
Equals(object)
Validate obj is a AnnotationId instance and have the same values as this instance.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | Compare the values with this instance. |
Returns
| Type | Description |
|---|---|
| bool | true if both instance have the same values; false otherwise. |
Overrides
Equals(AnnotationId)
Returns whether two AnnotationId objects are equals.
Declaration
public bool Equals(AnnotationId other)
Parameters
| Type | Name | Description |
|---|---|---|
| AnnotationId | other | The other AnnotationId to compare with this instance. |
Returns
| Type | Description |
|---|---|
| bool | true if both instance have the same values; false otherwise. |
GetHashCode()
Compute a hash code for the object.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |
Overrides
Remarks
- You should not assume that equal hash codes imply object equality.
- You should never persist or use a hash code outside the application domain in which it was created, because the same object may hash differently across application domains, processes, and platforms.
ToString()
Get the string representation of this AnnotationId.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | The string result. |
Overrides
Operators
operator ==(AnnotationId, AnnotationId)
Get if two AnnotationId represent the same.
Declaration
public static bool operator ==(AnnotationId left, AnnotationId right)
Parameters
| Type | Name | Description |
|---|---|---|
| AnnotationId | left | Compare with this first instance. |
| AnnotationId | right | Compare with this other instance. |
Returns
| Type | Description |
|---|---|
| bool |
explicit operator string(AnnotationId)
Explicitly cast a AnnotationId to a string
Declaration
public static explicit operator string(AnnotationId id)
Parameters
| Type | Name | Description |
|---|---|---|
| AnnotationId | id | Object to cast |
Returns
| Type | Description |
|---|---|
| string | The resulting string |
operator !=(AnnotationId, AnnotationId)
Get if two AnnotationId does not represent the same.
Declaration
public static bool operator !=(AnnotationId left, AnnotationId right)
Parameters
| Type | Name | Description |
|---|---|---|
| AnnotationId | left | Compare with this first instance. |
| AnnotationId | right | Compare with this other instance. |
Returns
| Type | Description |
|---|---|
| bool | true if both instances are not the same; false if both instances are the same. |