Class PostHogClientImpl

java.lang.Object
net.hollowcube.posthog.PostHogClientImpl
All Implemented Interfaces:
PostHogClient

public final class PostHogClientImpl extends Object implements PostHogClient
  • Method Details

    • shutdown

      public void shutdown(@NotNull @NotNull Duration timeout)
      Specified by:
      shutdown in interface PostHogClient
    • flush

      public void flush()
      Description copied from interface: PostHogClient
      Queue an immediate flush of the pending event queue. This call does not block on the flush to be completed.
      Specified by:
      flush in interface PostHogClient
    • capture

      public void capture(@NotNull @NotNull String distinctId, @NotNull @NotNull String event, @NotNull @NotNull Object properties)
      Description copied from interface: PostHogClient
      Capture 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:
      capture in interface PostHogClient
      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: PostHogClient
      Get the feature flag state for the given distinct ID with extra context.
      Specified by:
      getFeatureFlag in interface PostHogClient
      Parameters:
      key - Feature flag key
      distinctId - Unique ID of the target in your database. May not be empty
      context - 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: PostHogClient
      Get all feature flags for the given distinct ID with extra context.
      Specified by:
      getAllFeatureFlags in interface PostHogClient
      Parameters:
      distinctId - Unique ID of the target in your database. May not be empty
      context - Extra context to pass to the feature flag evaluation
      Returns:
      Feature flag states
    • reloadFeatureFlags

      public void reloadFeatureFlags()
      Description copied from interface: PostHogClient
      Triggers 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:
      reloadFeatureFlags in interface PostHogClient
    • captureException

      public void captureException(@NotNull @NotNull Throwable throwable, @Nullable @Nullable String distinctId, @Nullable @Nullable Object properties)
      Specified by:
      captureException in interface PostHogClient