Class AllQueryWordsTrigger

  • All Implemented Interfaces:
    Trigger, HasNoBeans

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

    A trigger which activates only when the current query contains all the words given as triggers.

    The query may contain other words without affecting the trigger, and the order of the words within the query is not considered important.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<java.lang.String> triggerWords
      The list of words required to be found within the query for this trigger to activate.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean activatesOn​(SearchTransaction searchTransaction)
      Check the given searchTransaction to see if the query contains all the required words for this trigger.
      void configure​(Configurer configurer)
      Configure this trigger (expected to autowire in any dependencies)
      boolean equals​(java.lang.Object o)  
      java.util.List<java.lang.String> getTriggerWords()  
      int hashCode()  
      void setTriggerWords​(java.util.List<java.lang.String> triggerWords)
      The list of words required to be found within the query for this trigger to activate.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • triggerWords

        private java.util.List<java.lang.String> triggerWords
        The list of words required to be found within the query for this trigger to activate.
    • Constructor Detail

      • AllQueryWordsTrigger

        public AllQueryWordsTrigger​(java.util.List<java.lang.String> triggerWords)
      • AllQueryWordsTrigger

        public AllQueryWordsTrigger()
    • Method Detail

      • getTriggerWords

        public java.util.List<java.lang.String> getTriggerWords()
      • activatesOn

        public boolean activatesOn​(SearchTransaction searchTransaction)
        Check the given searchTransaction to see if the query contains all the required words for this trigger. If it does, return true, otherwise 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
      • setTriggerWords

        public void setTriggerWords​(java.util.List<java.lang.String> triggerWords)
        The list of words required to be found within the query for this trigger to activate.