Record Class MentionRef

java.lang.Object
java.lang.Record
su.onno.ui.comments.MentionRef

public record MentionRef(String kind, String name, UUID id) extends Record
A typed reference embedded in a comment body — the comment-thread analogue of Ref<T>. It carries the same (kind, name, id) route triple the UI uses to address any record, where kind is "catalogs" or "documents" and name is the URL-safe route segment (snake_case logical name, e.g. "sales_orders"). Like every other ref in the framework, only the identity is stored — display, avatar and read access are resolved live (see MentionResolver) so renames and deletes stay correct automatically.

In a stored body a mention is a token of the form @[Display](kind/name/id); see Mentions for the parser/serializer. Two mentions are equal when their triples match, regardless of the snapshot label that accompanied them in the text.

  • Constructor Summary

    Constructors
    Constructor
    Description
    MentionRef(String kind, String name, UUID id)
    Creates an instance of a MentionRef record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    The UiAccessService entity type for this kind: "catalog"/"document".
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    id()
    Returns the value of the id record component.
    Returns the value of the kind record component.
    Returns the value of the name record component.
    The kind/name/id route segment, the body of an onno:// navigation url.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MentionRef

      public MentionRef(String kind, String name, UUID id)
      Creates an instance of a MentionRef record class.
      Parameters:
      kind - the value for the kind record component
      name - the value for the name record component
      id - the value for the id record component
  • Method Details

    • accessType

      public String accessType()
      The UiAccessService entity type for this kind: "catalog"/"document".
    • route

      public String route()
      The kind/name/id route segment, the body of an onno:// navigation url.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • kind

      public String kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • id

      public UUID id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component