Package net.hollowcube.posthog
Class PostHogClientImpl
java.lang.Object
net.hollowcube.posthog.PostHogClientImpl
- All Implemented Interfaces:
PostHogClient
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.hollowcube.posthog.PostHogClient
PostHogClient.Builder -
Method Summary
Modifier and TypeMethodDescriptionvoidCapture an event with the given name for the given ID with properties from the given object.voidcaptureException(@NotNull Throwable throwable, @Nullable String distinctId, @Nullable Object properties) voidflush()Queue an immediate flush of the pending event queue.@NotNull FeatureFlagStatesgetAllFeatureFlags(@NotNull String distinctId, @Nullable FeatureFlagContext context) Get all feature flags for the given distinct ID with extra context.@NotNull FeatureFlagStategetFeatureFlag(@NotNull String key, @NotNull String distinctId, @Nullable FeatureFlagContext context) Get the feature flag state for the given distinct ID with extra context.voidTriggers a full reload of all local feature flags from the remote server.voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.hollowcube.posthog.PostHogClient
alias, capture, capture, captureException, captureException, captureException, getAllFeatureFlags, getFeatureFlag, getFeatureFlagPayload, getFeatureFlagPayload, groupIdentify, groupIdentify, identify, identify, identify, identify, isFeatureEnabled, isFeatureEnabled, set, set, set, set
-
Method Details
-
shutdown
- Specified by:
shutdownin interfacePostHogClient
-
flush
public void flush()Description copied from interface:PostHogClientQueue an immediate flush of the pending event queue. This call does not block on the flush to be completed.- Specified by:
flushin interfacePostHogClient
-
capture
public void capture(@NotNull @NotNull String distinctId, @NotNull @NotNull String event, @NotNull @NotNull Object properties) Description copied from interface:PostHogClientCapture an event with the given name for the given ID with properties from the given object.The object must be serializable to a JSON object via Gson (not primitive or array)
- Specified by:
capturein interfacePostHogClient- Parameters:
distinctId- Unique ID of the target in your database. May not be empty.event- Name of the event. May not be empty.properties- Event object data
-
getFeatureFlag
@NotNull public @NotNull FeatureFlagState getFeatureFlag(@NotNull @NotNull String key, @NotNull @NotNull String distinctId, @Nullable @Nullable FeatureFlagContext context) Description copied from interface:PostHogClientGet the feature flag state for the given distinct ID with extra context.- Specified by:
getFeatureFlagin interfacePostHogClient- Parameters:
key- Feature flag keydistinctId- Unique ID of the target in your database. May not be emptycontext- Extra context to pass to the feature flag evaluation- Returns:
- Feature flag state
-
getAllFeatureFlags
@NotNull public @NotNull FeatureFlagStates getAllFeatureFlags(@NotNull @NotNull String distinctId, @Nullable @Nullable FeatureFlagContext context) Description copied from interface:PostHogClientGet all feature flags for the given distinct ID with extra context.- Specified by:
getAllFeatureFlagsin interfacePostHogClient- Parameters:
distinctId- Unique ID of the target in your database. May not be emptycontext- Extra context to pass to the feature flag evaluation- Returns:
- Feature flag states
-
reloadFeatureFlags
public void reloadFeatureFlags()Description copied from interface:PostHogClientTriggers a full reload of all local feature flags from the remote server. Only valid when local evaluation is enabled. This call does not block on the flush to be completed.- Specified by:
reloadFeatureFlagsin interfacePostHogClient
-
captureException
public void captureException(@NotNull @NotNull Throwable throwable, @Nullable @Nullable String distinctId, @Nullable @Nullable Object properties) - Specified by:
captureExceptionin interfacePostHogClient
-