Class UserSegmentTrigger

  • All Implemented Interfaces:
    Trigger

    public class UserSegmentTrigger
    extends java.lang.Object
    implements Trigger

    A trigger which activates only when the current request originates user matching some particular Predictive Segmenter constraint.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private StringMatchType matchType
      The type of matching to be performed between the user's detected segment (haystack) and the given segmentValue (needle).
      private java.lang.String segmentType
      The type of segment to check.
      private java.lang.String segmentValue
      The 'value' to check for in the segment data (currently a substring check)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean activatesOn​(SearchTransaction searchTransaction)
      Check whether the given searchTransaction originates from a country listed in targetCountries.
      protected boolean canEqual​(java.lang.Object other)  
      void configure​(Configurer configurer)
      Configure this trigger (expected to autowire in any dependencies)
      boolean equals​(java.lang.Object o)  
      StringMatchType getMatchType()
      The type of matching to be performed between the user's detected segment (haystack) and the given segmentValue (needle).
      java.lang.String getSegmentType()
      The type of segment to check.
      java.lang.String getSegmentValue()
      The 'value' to check for in the segment data (currently a substring check)
      int hashCode()  
      void setMatchType​(StringMatchType matchType)
      The type of matching to be performed between the user's detected segment (haystack) and the given segmentValue (needle).
      void setSegmentType​(java.lang.String segmentType)
      The type of segment to check.
      void setSegmentValue​(java.lang.String segmentValue)
      The 'value' to check for in the segment data (currently a substring check)
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • segmentType

        private java.lang.String segmentType
        The type of segment to check. Available segments depend on the fields in the predictive segmenter database in use.
      • segmentValue

        private java.lang.String segmentValue
        The 'value' to check for in the segment data (currently a substring check)
      • matchType

        private StringMatchType matchType
        The type of matching to be performed between the user's detected segment (haystack) and the given segmentValue (needle). Default setting is case sensitive substring matching.
    • Constructor Detail

      • UserSegmentTrigger

        public UserSegmentTrigger​(java.lang.String segmentType,
                                  java.lang.String segmentValue,
                                  StringMatchType matchType)
      • UserSegmentTrigger

        public UserSegmentTrigger()
    • Method Detail

      • activatesOn

        public boolean activatesOn​(SearchTransaction searchTransaction)
        Check whether the given searchTransaction originates from a country listed in targetCountries. 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
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

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

        public java.lang.String getSegmentType()
        The type of segment to check. Available segments depend on the fields in the predictive segmenter database in use.
      • setSegmentType

        public void setSegmentType​(java.lang.String segmentType)
        The type of segment to check. Available segments depend on the fields in the predictive segmenter database in use.
      • getSegmentValue

        public java.lang.String getSegmentValue()
        The 'value' to check for in the segment data (currently a substring check)
      • setSegmentValue

        public void setSegmentValue​(java.lang.String segmentValue)
        The 'value' to check for in the segment data (currently a substring check)
      • getMatchType

        public StringMatchType getMatchType()
        The type of matching to be performed between the user's detected segment (haystack) and the given segmentValue (needle). Default setting is case sensitive substring matching.
      • setMatchType

        public void setMatchType​(StringMatchType matchType)
        The type of matching to be performed between the user's detected segment (haystack) and the given segmentValue (needle). Default setting is case sensitive substring matching.