Class MentionNotificationParameters

  • All Implemented Interfaces:
    Serializable

    public class MentionNotificationParameters
    extends Object
    implements Serializable
    Contains the mentions for a change (creation or modification) on a given entity. The object contains two maps of mentions, storing respectively the list of all mentions of the entity, and the list of new mentions introduced by the change. The keys of the maps are the types of the mentioned users stored in the values. The value of the maps contains the list of mentions of a given type. In addition, the object contains the reference of the author of the change, the location of the entity (e.g., in a document or a comment), the reference of the changed entity, and the version of the entity after the change.
    Since:
    12.6
    Version:
    $Id: 94b713464500bcab5b5d3e249a8d7c6b897fd36d $
    See Also:
    Serialized Form
    • Constructor Detail

      • MentionNotificationParameters

        public MentionNotificationParameters​(String authorReference,
                                             EntityReference entityReference,
                                             MentionLocation location,
                                             String version)
        Parameters:
        authorReference - the reference of the author of the change that produced the mentions
        entityReference - the entity holding the mentions (a page content, a comment...)
        location - the pre-calculated location of the entity
        version - version of the document where the mention occurred
    • Method Detail

      • getAuthorReference

        public String getAuthorReference()
        Returns:
        the reference of the author of the mention
      • getEntityReference

        public EntityReference getEntityReference()
        Returns:
        the document in which the mention has been done
      • getLocation

        public MentionLocation getLocation()
        Returns:
        the location of the mention
      • addNewMention

        public MentionNotificationParameters addNewMention​(String type,
                                                           MentionNotificationParameter mentionedActorReference)
        Add a mention to the map of new mentions.
        Parameters:
        type - the type of the mentioned actor
        mentionedActorReference - the mention notification parameter
        Returns:
        the current object
      • getNewMentions

        public Map<String,​Set<MentionNotificationParameter>> getNewMentions()
        Returns an unmodifable map of the new mentions. The type of the mentioned actors are used as keys, and the values are MentionNotificationParameter, identifying a unique mention in a page by its actor reference and its anchor.
        Returns:
        the map of new mentions
      • getMentions

        public Map<String,​Set<MentionNotificationParameter>> getMentions()
        Returns an unmodifiable map of all the mentions, including the new ones. The type of the mentioned actors are used as keys, and the values are MentionNotificationParameter, identifying a unique mention in a page by its actor reference and its anchor.
        Returns:
        the map of all the mentions
      • getVersion

        public String getVersion()
        Returns:
        the version of the document where the mentions occurred
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object