Class ModerationDecisionImpl
- java.lang.Object
-
- org.craftercms.social.moderation.impl.ModerationDecisionImpl
-
- All Implemented Interfaces:
ModerationDecision
public class ModerationDecisionImpl extends Object implements ModerationDecision
Using the ModerationFilters decides if a UGC have to be moderate or not
The neither ModerationDecisionImpl or the Filters modified the UGC
The decision is taken base on the first- Author:
- cortiz
-
-
Constructor Summary
Constructors Constructor Description ModerationDecisionImpl(List<ModerationFilter> filters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isTrash(SocialUgc ugc)
SetUGC
as Trashboolean
needModeration(SocialUgc ugc)
Makes the decision if aUGC
has to be moderated based onModerationFilter.needModeration(SocialUgc)
result returns True if at least one ofModerationFilter
returns truevoid
setMaxFlagsBeforeTrash(int maxFlags)
Sets the number of user flags threshold before theUGC
is sent to the trash.
-
-
-
Constructor Detail
-
ModerationDecisionImpl
@ConstructorProperties("filters") public ModerationDecisionImpl(List<ModerationFilter> filters)
-
-
Method Detail
-
needModeration
public boolean needModeration(SocialUgc ugc)
Description copied from interface:ModerationDecision
Makes the decision if aUGC
has to be moderated based onModerationFilter.needModeration(SocialUgc)
result returns True if at least one ofModerationFilter
returns true- Specified by:
needModeration
in interfaceModerationDecision
- Parameters:
ugc
- UGC to test- Returns:
- True if at least one
ModerationFilter.needModeration(SocialUgc)
returns true;
-
isTrash
public boolean isTrash(SocialUgc ugc)
Description copied from interface:ModerationDecision
SetUGC
as Trash- Specified by:
isTrash
in interfaceModerationDecision
- Parameters:
ugc
- theUGC
to be trashed- Returns:
- true if it can be set in the trash.
-
setMaxFlagsBeforeTrash
public void setMaxFlagsBeforeTrash(int maxFlags)
Description copied from interface:ModerationDecision
Sets the number of user flags threshold before theUGC
is sent to the trash.- Specified by:
setMaxFlagsBeforeTrash
in interfaceModerationDecision
- Parameters:
maxFlags
- Maximum number of flags (unique flags).
-
-