Package org.xwiki.mentions.notifications
Class MentionNotificationParameters
- java.lang.Object
-
- org.xwiki.mentions.notifications.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 Summary
Constructors Constructor Description MentionNotificationParameters(String authorReference, EntityReference entityReference, MentionLocation location, String version)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MentionNotificationParameters
addMention(String type, MentionNotificationParameter mentionedActorReference)
Add a mention to the map of mentions.MentionNotificationParameters
addNewMention(String type, MentionNotificationParameter mentionedActorReference)
Add a mention to the map of new mentions.boolean
equals(Object o)
String
getAuthorReference()
EntityReference
getEntityReference()
MentionLocation
getLocation()
Map<String,Set<MentionNotificationParameter>>
getMentions()
Returns an unmodifiable map of all the mentions, including the new ones.Map<String,Set<MentionNotificationParameter>>
getNewMentions()
Returns an unmodifable map of the new mentions.String
getVersion()
int
hashCode()
String
toString()
-
-
-
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 mentionsentityReference
- the entity holding the mentions (a page content, a comment...)location
- the pre-calculated location of the entityversion
- 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
-
addMention
public MentionNotificationParameters addMention(String type, MentionNotificationParameter mentionedActorReference)
Add a mention to the map of mentions.- Parameters:
type
- the type of the mentioned actormentionedActorReference
- the mention notification parameters- Returns:
- the current object
-
addNewMention
public MentionNotificationParameters addNewMention(String type, MentionNotificationParameter mentionedActorReference)
Add a mention to the map of new mentions.- Parameters:
type
- the type of the mentioned actormentionedActorReference
- 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 areMentionNotificationParameter
, 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 areMentionNotificationParameter
, 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
-
-