Class QuerySubstringTrigger

  • All Implemented Interfaces:
    Trigger, HasNoBeans

    public final class QuerySubstringTrigger
    extends java.lang.Object
    implements Trigger, HasNoBeans

    A trigger which activates when the given substring is contained within the current query.

    Case is considered important in the matching (so a trigger with substring "Bob" will not match the query "bob and jane", but "bob" would).

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String triggerSubstring
      The substring to check for in the current query.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean activatesOn​(SearchTransaction searchTransaction)
      Return true if the current query in searchTransaction contains the triggerSubstring, otherwise return false.
      void configure​(Configurer configurer)
      Configure this trigger (expected to autowire in any dependencies)
      boolean equals​(java.lang.Object o)  
      java.lang.String getTriggerSubstring()
      The substring to check for in the current query.
      int hashCode()  
      void setTriggerSubstring​(java.lang.String triggerSubstring)
      The substring to check for in the current query.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • triggerSubstring

        private java.lang.String triggerSubstring
        The substring to check for in the current query.
    • Constructor Detail

      • QuerySubstringTrigger

        public QuerySubstringTrigger​(java.lang.String triggerSubstring)
      • QuerySubstringTrigger

        public QuerySubstringTrigger()
    • Method Detail

      • activatesOn

        public boolean activatesOn​(SearchTransaction searchTransaction)
        Return true if the current query in searchTransaction contains the triggerSubstring, otherwise return false.
        Specified by:
        activatesOn in interface Trigger
        Parameters:
        searchTransaction - Current search transaction
        Returns:
        true if this trigger should activate on the given searchTransaction, and false otherwise.
      • configure

        public void configure​(Configurer configurer)
        Configure this trigger (expected to autowire in any dependencies)
        Specified by:
        configure in interface Trigger
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getTriggerSubstring

        public java.lang.String getTriggerSubstring()
        The substring to check for in the current query.
      • setTriggerSubstring

        public void setTriggerSubstring​(java.lang.String triggerSubstring)
        The substring to check for in the current query.