Package org.ametys.cms.repository
Class ReactionableObjectHelper
- java.lang.Object
-
- org.ametys.cms.repository.ReactionableObjectHelper
-
public final class ReactionableObjectHelper extends Object
Helper class which provides methods to manage reactions on a object
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ReactionableObjectHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static ModifiableModelLessComposite
_getReactionsHolder(ModifiableModelLessDataHolder unversionedDataHolder, ReactionableObject.ReactionType reactionType)
private static UserIdentity[]
_getUsers(ModelLessDataHolder dataHolder)
static void
addReaction(ModifiableModelLessDataHolder unversionedDataHolder, UserIdentity user, ReactionableObject.ReactionType reactionType)
Add a user reactionstatic List<UserIdentity>
getReactionUsers(ModifiableModelLessDataHolder unversionedDataHolder, ReactionableObject.ReactionType reactionType)
Get the issuers of a reactionstatic void
removeReaction(ModifiableModelLessDataHolder unversionedDataHolder, UserIdentity user, ReactionableObject.ReactionType reactionType)
Remove a user reaction
-
-
-
Constructor Detail
-
ReactionableObjectHelper
private ReactionableObjectHelper()
-
-
Method Detail
-
addReaction
public static void addReaction(ModifiableModelLessDataHolder unversionedDataHolder, UserIdentity user, ReactionableObject.ReactionType reactionType)
Add a user reaction- Parameters:
unversionedDataHolder
- the unversioned data holderuser
- the issuer of reactionreactionType
- the reaction type
-
removeReaction
public static void removeReaction(ModifiableModelLessDataHolder unversionedDataHolder, UserIdentity user, ReactionableObject.ReactionType reactionType)
Remove a user reaction- Parameters:
unversionedDataHolder
- the unversioned data holderuser
- the issuer of reaction to removereactionType
- the reaction type
-
getReactionUsers
public static List<UserIdentity> getReactionUsers(ModifiableModelLessDataHolder unversionedDataHolder, ReactionableObject.ReactionType reactionType)
Get the issuers of a reaction- Parameters:
unversionedDataHolder
- the unversioned data holderreactionType
- the reaction type- Returns:
- the issuers of a reaction as a List
-
_getReactionsHolder
private static ModifiableModelLessComposite _getReactionsHolder(ModifiableModelLessDataHolder unversionedDataHolder, ReactionableObject.ReactionType reactionType)
-
_getUsers
private static UserIdentity[] _getUsers(ModelLessDataHolder dataHolder)
-
-