Class DevCycleLocalClient

java.lang.Object
com.devcycle.sdk.server.local.api.DevCycleLocalClient
All Implemented Interfaces:
IDevCycleClient

public final class DevCycleLocalClient extends Object implements IDevCycleClient
  • Constructor Details

    • DevCycleLocalClient

      public DevCycleLocalClient(String sdkKey)
    • DevCycleLocalClient

      public DevCycleLocalClient(String sdkKey, DevCycleLocalOptions dvcOptions)
  • Method Details

    • isInitialized

      public boolean isInitialized()
      Specified by:
      isInitialized in interface IDevCycleClient
      Returns:
      true if the DevCycleLocalClient is fully initialized and has successfully loaded a configuration
    • allFeatures

      public Map<String,Feature> allFeatures(DevCycleUser user)
      Get all features for user data
      Parameters:
      user - (required)
    • variableValue

      public <T> T variableValue(DevCycleUser user, String key, T defaultValue)
      Get variable value by key for user data
      Specified by:
      variableValue in interface IDevCycleClient
      Parameters:
      user - (required)
      key - Feature key (required)
      defaultValue - Default value to use if the variable could not be fetched (required)
      Returns:
      Variable value
    • variable

      public <T> Variable<T> variable(DevCycleUser user, String key, T defaultValue)
      Get variable by key for user data
      Specified by:
      variable in interface IDevCycleClient
      Parameters:
      user - (required)
      key - Variable key (required)
      defaultValue - Default value to use if the variable could not be fetched (required)
      Returns:
      Variable
    • getMetadata

      public ConfigMetadata getMetadata()
    • allVariables

      public Map<String,BaseVariable> allVariables(DevCycleUser user)
      Get all variables by key for user data
      Parameters:
      user - (required)
    • track

      public void track(DevCycleUser user, DevCycleEvent event)
      Post events to DevCycle for user
      Specified by:
      track in interface IDevCycleClient
      Parameters:
      user - (required)
      event - (required)
    • setClientCustomData

      public void setClientCustomData(Map<String,Object> customData)
    • close

      public void close()
      Gracefully close the client
      Specified by:
      close in interface IDevCycleClient
    • addHook

      public void addHook(EvalHook hook)
      Add an evaluation hook to the client
      Parameters:
      hook - The hook to add
    • clearHooks

      public void clearHooks()
      Remove all evaluation hooks from the client
    • getOpenFeatureProvider

      public dev.openfeature.sdk.FeatureProvider getOpenFeatureProvider()
      Specified by:
      getOpenFeatureProvider in interface IDevCycleClient
      Returns:
      the OpenFeature provider for this client.
    • getSDKPlatform

      public String getSDKPlatform()
      Specified by:
      getSDKPlatform in interface IDevCycleClient