-
public final class TriggerAdapterClass responsible for adapting trigger conditions from a JSON object.
-
-
Field Summary
Fields Modifier and Type Field Description private final StringeventNameprivate final JSONArraypropertiesprivate final JSONArrayitemsprivate final JSONArraygeoRadiusArrayprivate final StringprofileAttrNameprivate final BooleanfirstTimeOnlyprivate final IntegerpropertyCountprivate final IntegeritemsCountprivate final IntegergeoRadiusCount
-
Constructor Summary
Constructors Constructor Description TriggerAdapter(JSONObject triggerJSON)
-
Method Summary
Modifier and Type Method Description final StringgetEventName()The name of the event associated with the trigger conditions. final JSONArraygetProperties()The JSONArray containing event property trigger conditions. final JSONArraygetItems()The JSONArray containing item property trigger conditions.Used for Charged event. final JSONArraygetGeoRadiusArray()The JSONArray containing Geographic radius trigger conditions. final StringgetProfileAttrName()The string associated with the attribute name for changes in the user-profile Used for user attribute changes trigger conditions final BooleangetFirstTimeOnly()final IntegergetPropertyCount()final IntegergetItemsCount()final IntegergetGeoRadiusCount()final TriggerConditiontriggerConditionFromJSON(JSONObject property)Internal function to create a TriggerCondition from a JSON property object. final TriggerConditionpropertyAtIndex(Integer index)Retrieve a TriggerCondition at the specified index from event properties. final TriggerConditionitemAtIndex(Integer index)Retrieve a TriggerCondition at the specified index from item properties. final TriggerGeoRadiusgeoRadiusAtIndex(Integer index)Retrieves a TriggerGeoRadius instance at the specified index from the geoRadiusArray. -
-
Constructor Detail
-
TriggerAdapter
TriggerAdapter(JSONObject triggerJSON)
- Parameters:
triggerJSON- The JSON object containing trigger conditions.
-
-
Method Detail
-
getEventName
final String getEventName()
The name of the event associated with the trigger conditions.
-
getProperties
final JSONArray getProperties()
The JSONArray containing event property trigger conditions.
-
getItems
final JSONArray getItems()
The JSONArray containing item property trigger conditions.Used for Charged event.
-
getGeoRadiusArray
final JSONArray getGeoRadiusArray()
The JSONArray containing Geographic radius trigger conditions. Used for location-based trigger conditions within a specified geographical radius.
-
getProfileAttrName
final String getProfileAttrName()
The string associated with the attribute name for changes in the user-profile Used for user attribute changes trigger conditions
-
getFirstTimeOnly
final Boolean getFirstTimeOnly()
-
getPropertyCount
final Integer getPropertyCount()
-
getItemsCount
final Integer getItemsCount()
-
getGeoRadiusCount
final Integer getGeoRadiusCount()
-
triggerConditionFromJSON
final TriggerCondition triggerConditionFromJSON(JSONObject property)
Internal function to create a TriggerCondition from a JSON property object.
- Parameters:
property- The JSON object representing a trigger condition property.
-
propertyAtIndex
final TriggerCondition propertyAtIndex(Integer index)
Retrieve a TriggerCondition at the specified index from event properties.
- Parameters:
index- The index of the TriggerCondition to retrieve.
-
itemAtIndex
final TriggerCondition itemAtIndex(Integer index)
Retrieve a TriggerCondition at the specified index from item properties.
- Parameters:
index- The index of the TriggerCondition to retrieve.
-
geoRadiusAtIndex
final TriggerGeoRadius geoRadiusAtIndex(Integer index)
Retrieves a TriggerGeoRadius instance at the specified index from the geoRadiusArray.
The function checks if the provided index is valid and, if so, extracts the latitude, longitude, and radius information from the corresponding JSON object within the geoRadiusArray. It then creates and returns a TriggerGeoRadius instance based on the extracted data.
- Parameters:
index- The index indicating the position of the desired TriggerGeoRadius in the geoRadiusArray.
-
-
-
-