namespace Uwaa.Pleroma; /// /// Base class for ActivityStreams objects. /// public class ASObject { /// /// Pleroma uses 128-bit ids as opposed to Mastodon's 64 bits. However just like Mastodon's ids they are lexically sortable strings /// [JsonPropertyName("id")] public string ID { get; set; } = null!; [JsonConstructor()] internal ASObject() { } public override string ToString() => ID; public override bool Equals(object? obj) => Equals(obj as ASObject); public bool Equals(ASObject? other) => other is not null && ID == other.ID; public static bool operator ==(ASObject? left, ASObject? right) => EqualityComparer.Default.Equals(left, right); public static bool operator !=(ASObject? left, ASObject? right) => !(left == right); public override int GetHashCode() => ID.GetHashCode(); }