Class CountryNameTrigger
- java.lang.Object
-
- com.funnelback.publicui.search.model.curator.trigger.CountryNameTrigger
-
- All Implemented Interfaces:
Trigger
,HasNoBeans
public final class CountryNameTrigger extends java.lang.Object implements Trigger, HasNoBeans
A trigger which activates only when the current request originates from a country whose name exists in the targetCountries list.
The detection of the originating country requires geolocation to be active (otherwise this trigger will never activate).
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.lang.String>
targetCountries
The list of country names (case sensitive) for which this trigger should activate.
-
Constructor Summary
Constructors Constructor Description CountryNameTrigger()
CountryNameTrigger(java.util.Set<java.lang.String> targetCountries)
-
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.void
configure(Configurer configurer)
Configure this trigger (expected to autowire in any dependencies)boolean
equals(java.lang.Object o)
java.util.Set<java.lang.String>
getTargetCountries()
The list of country names (case sensitive) for which this trigger should activate.int
hashCode()
void
setTargetCountries(java.util.Set<java.lang.String> targetCountries)
The list of country names (case sensitive) for which this trigger should activate.java.lang.String
toString()
-
-
-
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 interfaceTrigger
- 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)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getTargetCountries
public java.util.Set<java.lang.String> getTargetCountries()
The list of country names (case sensitive) for which this trigger should activate.
-
setTargetCountries
public void setTargetCountries(java.util.Set<java.lang.String> targetCountries)
The list of country names (case sensitive) for which this trigger should activate.
-
-