public class Options
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ALL_INTEGRATIONS_KEY
A special key, whose value which is respected for all integrations, a "default" value, unless
explicitly overridden.
|
Constructor and Description |
---|
Options() |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
context()
Returns a copy of the context.
|
java.util.Map<java.lang.String,java.lang.Object> |
integrations()
Returns a copy of settings for integrations.
|
Options |
putContext(java.lang.String key,
java.lang.Object value)
Attach some additional context information.
|
Options |
setIntegration(Analytics.BundledIntegration bundledIntegration,
boolean enabled)
Sets whether an action will be sent to the target integration.
|
Options |
setIntegration(java.lang.String integrationKey,
boolean enabled)
Sets whether an action will be sent to the target integration.
|
Options |
setIntegrationOptions(Analytics.BundledIntegration bundledIntegration,
java.util.Map<java.lang.String,java.lang.Object> options)
Attach some integration specific options for this call.
|
Options |
setIntegrationOptions(java.lang.String integrationKey,
java.util.Map<java.lang.String,java.lang.Object> options)
Attach some integration specific options for this call.
|
public static final java.lang.String ALL_INTEGRATIONS_KEY
setIntegration(String, boolean)
on
how to use this key.public Options setIntegration(java.lang.String integrationKey, boolean enabled)
By default, all integrations are sent a payload, and the value for the ALL_INTEGRATIONS_KEY
is true
. You can disable specific payloads.
Example: options.setIntegration("Google Analytics", false).setIntegration("Countly",
false)
will send the event to ALL integrations, except Google Analytic and Countly.
If you want to enable only specific integrations, first override the defaults and then enable specific integrations.
Example: options.setIntegration(Options.ALL_INTEGRATIONS_KEY,
false).setIntegration("Countly", true).setIntegration("Google Analytics", true)
will
only send events to ONLY Countly and Google Analytics.
integrationKey
- The integration keyenabled
- true
for enabled, false
for disabledpublic Options setIntegration(Analytics.BundledIntegration bundledIntegration, boolean enabled)
setIntegration(String, boolean)
but type safe for bundled integrations.bundledIntegration
- The target integrationenabled
- true
for enabled, false
for disabledsetIntegration(String, boolean)
public Options setIntegrationOptions(java.lang.String integrationKey, java.util.Map<java.lang.String,java.lang.Object> options)
integrationKey
- The target integration keyoptions
- A map of data that will be used by the integrationpublic Options setIntegrationOptions(Analytics.BundledIntegration bundledIntegration, java.util.Map<java.lang.String,java.lang.Object> options)
setIntegrationOptions(String, Map)
but type safe for bundled integrations.bundledIntegration
- The target integrationoptions
- A map of data that will be used by the integrationpublic Options putContext(java.lang.String key, java.lang.Object value)
Analytics.getAnalyticsContext()
, this only has effect for this call.key
- The key of the extra context datavalue
- The value of the extra context datapublic java.util.Map<java.lang.String,java.lang.Object> integrations()
public java.util.Map<java.lang.String,java.lang.Object> context()