Class CustomKeywordTriggerConfig

All Implemented Interfaces:
TriggerConfig, SerializableData

public class CustomKeywordTriggerConfig extends AbstractKeywordTriggerConfig<CustomKeywordTriggerConfig>
Configuration for a KEYWORD trigger.
  • Method Details

    • addKeywords

      @Nonnull public CustomKeywordTriggerConfig addKeywords(@Nonnull String... keywords)
      Add more keywords match against.
      Keywords are matched case-insensitively, and may also contain whitespace.

      You can use wildcards at the keyword boundaries to extend the matches:
      "foo*" can match "foo", "foobar", "foo-bar", etc.
      "*foo*" can match "foo", "foobar", "barfoo", etc.
      "*foo" can match "foo", "barfoo", "bar-foo", etc.

      You can also use regex patterns using TriggerConfig.patternFilter(String...).

      Parameters:
      keywords - The keywords to match
      Returns:
      The current config for chaining convenience
      Throws:
      IllegalArgumentException -
      • If any of the keywords are empty, blank, or null
      • If more than 1000 keywords are added
      • If any of the keywords is longer than 60 characters
    • addKeywords

      Add more keywords match against.
      Keywords are matched case-insensitively, and may also contain whitespace.

      You can use wildcards at the keyword boundaries to extend the matches:
      "foo*" can match "foo", "foobar", "foo-bar", etc.
      "*foo*" can match "foo", "foobar", "barfoo", etc.
      "*foo" can match "foo", "barfoo", "bar-foo", etc.

      You can also use regex patterns using TriggerConfig.patternFilter(Collection).

      Parameters:
      keywords - The keywords to match
      Returns:
      The current config for chaining convenience
      Throws:
      IllegalArgumentException -
      • If any of the keywords are empty, blank, or null
      • If more than 1000 keywords are added
      • If any of the keywords is longer than 60 characters
    • setKeywords

      Changes the keywords to match against to the new list.
      Keywords are matched case-insensitively, and may also contain whitespace.

      You can use wildcards at the keyword boundaries to extend the matches:
      "foo*" can match "foo", "foobar", "foo-bar", etc.
      "*foo*" can match "foo", "foobar", "barfoo", etc.
      "*foo" can match "foo", "barfoo", "bar-foo", etc.

      You can also use regex patterns using TriggerConfig.patternFilter(Collection).

      Parameters:
      keywords - The keywords to match
      Returns:
      The current config for chaining convenience
      Throws:
      IllegalArgumentException -
      • If any of the keywords are empty, blank, or null
      • If more than 1000 keywords are added
      • If any of the keywords is longer than 60 characters
    • addPatterns

      @Nonnull public CustomKeywordTriggerConfig addPatterns(@Nonnull String... patterns)
      Add keywords regex patterns to match against.
      Keyword patterns are matched case-insensitively, and may also contain whitespace.

      Patterns may use anything supported by the rust regex crate. You can use a validator such as Rustexp to validate your pattern.

      You can also use simple substring keywords using TriggerConfig.keywordFilter(String...).

      Parameters:
      patterns - The keyword patterns to match
      Returns:
      The current config for chaining convenience
      Throws:
      IllegalArgumentException -
      • If any of the patterns are empty, blank, or null
      • If more than 10 patterns are added
      • If any of the patterns is longer than 260 characters
    • addPatterns

      Add keywords regex patterns to match against.
      Keyword patterns are matched case-insensitively, and may also contain whitespace.

      Patterns may use anything supported by the rust regex crate. You can use a validator such as Rustexp to validate your pattern.

      You can also use simple substring keywords using TriggerConfig.keywordFilter(String...).

      Parameters:
      patterns - The keyword patterns to match
      Returns:
      The current config for chaining convenience
      Throws:
      IllegalArgumentException -
      • If any of the patterns are empty, blank, or null
      • If more than 10 patterns are added
      • If any of the patterns is longer than 260 characters
    • setPatterns

      Change the list of keywords regex patterns to match against.
      Keyword patterns are matched case-insensitively, and may also contain whitespace.

      Patterns may use anything supported by the rust regex crate. You can use a validator such as Rustexp to validate your pattern.

      You can also use simple substring keywords using TriggerConfig.keywordFilter(String...).

      Parameters:
      patterns - The keyword patterns to match
      Returns:
      The current config for chaining convenience
      Throws:
      IllegalArgumentException -
      • If any of the patterns are empty, blank, or null
      • If more than 10 patterns are added
      • If any of the patterns is longer than 260 characters
    • toData

      @Nonnull public DataObject toData()
      Description copied from interface: SerializableData
      Serialized DataObject for this object.
      Specified by:
      toData in interface SerializableData
      Overrides:
      toData in class AbstractKeywordTriggerConfig<CustomKeywordTriggerConfig>
      Returns:
      DataObject