Class SocialFilterRegex
java.lang.Object
ovh.mythmc.social.api.text.filter.SocialFilterRegex
- All Implemented Interfaces:
SocialFilterLike,SocialContextualParser,SocialUserInputParser
- Direct Known Subclasses:
SocialFilterLiteral
Abstract parser capable of censoring text by matching a given regular expression.
Any text matching regex() will be filtered out and replaced
with ***.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparse(SocialParserContext context) Parses the givenSocialParserContextand returns aComponentrepresentation.abstract Stringregex()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ovh.mythmc.social.api.text.parser.SocialContextualParser
supportsOfflinePlayers
-
Constructor Details
-
SocialFilterRegex
public SocialFilterRegex()
-
-
Method Details
-
regex
-
parse
Description copied from interface:SocialContextualParserParses the givenSocialParserContextand returns aComponentrepresentation.- Specified by:
parsein interfaceSocialContextualParser- Parameters:
context- the context in which the message is being parsed. It contains information such as the sender, the original message, and other contextual information.- Returns:
- a
Componentrepresenting the parsed message.
-