Class ExactQueryTrigger

  • All Implemented Interfaces:
    Trigger, HasNoBeans

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

    A trigger which activates only when the current query exactly matches the given trigger query.

    Case between the queries may optionally be ignored.

    The word order within the query is always considered significant.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean ignoreCase
      Whether to consider case difference between the query and trigger as important (defaults to false).
      private java.lang.String triggerQuery
      The string the given query must match for this trigger to activate.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean activatesOn​(SearchTransaction searchTransaction)
      Return true if the query within searchTransaction exactly matches the triggerQuery (subject to ignoreCase), 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 getTriggerQuery()
      The string the given query must match for this trigger to activate.
      int hashCode()  
      boolean isIgnoreCase()
      Whether to consider case difference between the query and trigger as important (defaults to false).
      void setIgnoreCase​(boolean ignoreCase)
      Whether to consider case difference between the query and trigger as important (defaults to false).
      void setTriggerQuery​(java.lang.String triggerQuery)
      The string the given query must match 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

      • triggerQuery

        private java.lang.String triggerQuery
        The string the given query must match for this trigger to activate.
      • ignoreCase

        private boolean ignoreCase
        Whether to consider case difference between the query and trigger as important (defaults to false).
    • Constructor Detail

      • ExactQueryTrigger

        public ExactQueryTrigger​(java.lang.String triggerQuery,
                                 boolean ignoreCase)
      • ExactQueryTrigger

        public ExactQueryTrigger()
    • Method Detail

      • activatesOn

        public boolean activatesOn​(SearchTransaction searchTransaction)
        Return true if the query within searchTransaction exactly matches the triggerQuery (subject to ignoreCase), 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
      • getTriggerQuery

        public java.lang.String getTriggerQuery()
        The string the given query must match for this trigger to activate.
      • setTriggerQuery

        public void setTriggerQuery​(java.lang.String triggerQuery)
        The string the given query must match for this trigger to activate.
      • isIgnoreCase

        public boolean isIgnoreCase()
        Whether to consider case difference between the query and trigger as important (defaults to false).
      • setIgnoreCase

        public void setIgnoreCase​(boolean ignoreCase)
        Whether to consider case difference between the query and trigger as important (defaults to false).