Package com.posthog.server
Class PostHogCaptureOptions.Builder
-
- All Implemented Interfaces:
public final class PostHogCaptureOptions.Builder
-
-
Field Summary
Fields Modifier and Type Field Description private Map<String, Object>propertiesprivate Map<String, Object>userPropertiesprivate Map<String, Object>userPropertiesSetOnceprivate Map<String, String>groupsprivate Datetimestampprivate BooleanappendFeatureFlags
-
Constructor Summary
Constructors Constructor Description PostHogCaptureOptions.Builder()
-
Method Summary
Modifier and Type Method Description final Map<String, Object>getProperties()final UnitsetProperties(Map<String, Object> properties)final Map<String, Object>getUserProperties()final UnitsetUserProperties(Map<String, Object> userProperties)final Map<String, Object>getUserPropertiesSetOnce()final UnitsetUserPropertiesSetOnce(Map<String, Object> userPropertiesSetOnce)final Map<String, String>getGroups()final UnitsetGroups(Map<String, String> groups)final DategetTimestamp()final UnitsetTimestamp(Date timestamp)final BooleangetAppendFeatureFlags()final UnitsetAppendFeatureFlags(Boolean appendFeatureFlags)final PostHogCaptureOptions.Builderproperty(String key, Object value)Add a single custom property to the capture options final PostHogCaptureOptions.Builderproperties(Map<String, Object> properties)Appends multiple custom properties to the capture options final PostHogCaptureOptions.BuilderuserProperty(String key, Object value)Adds a single user property to the capture options final PostHogCaptureOptions.BuilderuserProperties(Map<String, Object> userProperties)Appends multiple user properties to the capture options. final PostHogCaptureOptions.BuilderuserPropertySetOnce(String key, Object value)Adds a single user property (set once) to the capture options. final PostHogCaptureOptions.BuilderuserPropertiesSetOnce(Map<String, Object> userPropertiesSetOnce)Appends multiple user properties (set once) to the capture options. final PostHogCaptureOptions.Buildergroup(String type, String key)Adds a single group to the capture options. final PostHogCaptureOptions.Buildergroups(Map<String, String> groups)Appends multiple groups to the capture options. final PostHogCaptureOptions.Buildertimestamp(Date date)Override the timestamp for the event. final PostHogCaptureOptions.Buildertimestamp(Long epochMillis)Override the timestamp for the event. final PostHogCaptureOptions.Buildertimestamp(Instant instant)Override the timestamp for the event. final PostHogCaptureOptions.BuilderappendFeatureFlags(Boolean appendFeatureFlags)When true, enriches the event with all evaluated feature flags. final PostHogCaptureOptionsbuild()-
-
Method Detail
-
getProperties
final Map<String, Object> getProperties()
-
setProperties
final Unit setProperties(Map<String, Object> properties)
-
getUserProperties
final Map<String, Object> getUserProperties()
-
setUserProperties
final Unit setUserProperties(Map<String, Object> userProperties)
-
getUserPropertiesSetOnce
final Map<String, Object> getUserPropertiesSetOnce()
-
setUserPropertiesSetOnce
final Unit setUserPropertiesSetOnce(Map<String, Object> userPropertiesSetOnce)
-
getTimestamp
final Date getTimestamp()
-
setTimestamp
final Unit setTimestamp(Date timestamp)
-
getAppendFeatureFlags
final Boolean getAppendFeatureFlags()
-
setAppendFeatureFlags
final Unit setAppendFeatureFlags(Boolean appendFeatureFlags)
-
property
final PostHogCaptureOptions.Builder property(String key, Object value)
Add a single custom property to the capture options
-
properties
final PostHogCaptureOptions.Builder properties(Map<String, Object> properties)
Appends multiple custom properties to the capture options
-
userProperty
final PostHogCaptureOptions.Builder userProperty(String key, Object value)
Adds a single user property to the capture options
-
userProperties
final PostHogCaptureOptions.Builder userProperties(Map<String, Object> userProperties)
Appends multiple user properties to the capture options.
-
userPropertySetOnce
final PostHogCaptureOptions.Builder userPropertySetOnce(String key, Object value)
Adds a single user property (set once) to the capture options.
-
userPropertiesSetOnce
final PostHogCaptureOptions.Builder userPropertiesSetOnce(Map<String, Object> userPropertiesSetOnce)
Appends multiple user properties (set once) to the capture options.
-
group
final PostHogCaptureOptions.Builder group(String type, String key)
Adds a single group to the capture options.
-
groups
final PostHogCaptureOptions.Builder groups(Map<String, String> groups)
Appends multiple groups to the capture options.
-
timestamp
final PostHogCaptureOptions.Builder timestamp(Date date)
Override the timestamp for the event.
-
timestamp
final PostHogCaptureOptions.Builder timestamp(Long epochMillis)
Override the timestamp for the event.
-
timestamp
final PostHogCaptureOptions.Builder timestamp(Instant instant)
Override the timestamp for the event.
-
appendFeatureFlags
final PostHogCaptureOptions.Builder appendFeatureFlags(Boolean appendFeatureFlags)
When true, enriches the event with all evaluated feature flags. Adds
$feature/{flagName}properties for each flag and$active_feature_flagsarray containing names of all truthy flags.
-
build
final PostHogCaptureOptions build()
-
-
-
-