public class FlagsmithApiWrapper extends Object implements FlagsmithSdk
| Constructor and Description |
|---|
FlagsmithApiWrapper(FlagsmithCache cache,
FlagsmithConfig defaultConfig,
HashMap<String,String> customHeaders,
FlagsmithLogger logger,
String apiKey)
Instantiate with cache.
|
FlagsmithApiWrapper(FlagsmithConfig defaultConfig,
HashMap<String,String> customHeaders,
FlagsmithLogger logger,
String apiKey)
Instantiate with config, custom headers, logger and apikey.
|
FlagsmithApiWrapper(FlagsmithConfig defaultConfig,
HashMap<String,String> customHeaders,
FlagsmithLogger logger,
String apiKey,
RequestProcessor requestProcessor)
Instantiate with config, custom headers, logger, apikey and request processor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the FlagsmithAPIWrapper instance, cleaning up any dependent threads or services
which need cleaning up before the instance can be fully destroyed.
|
FlagsmithCache |
getCache() |
FlagsmithConfig |
getConfig() |
EnvironmentModel |
getEnvironment() |
Flags |
getFeatureFlags(boolean doThrow)
Get Feature Flags from API.
|
FlagsmithLogger |
getLogger() |
RequestProcessor |
getRequestor() |
Flags |
identifyUserWithTraits(String identifier,
List<TraitModel> traits,
boolean doThrow) |
okhttp3.Request |
newGetRequest(okhttp3.HttpUrl url)
Returns a build request with GET.
|
okhttp3.Request |
newPostRequest(okhttp3.HttpUrl url,
okhttp3.RequestBody body)
Returns a build request with GET.
|
void |
setRequestor(RequestProcessor requestor) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitassertValidUserpublic FlagsmithApiWrapper(FlagsmithCache cache, FlagsmithConfig defaultConfig, HashMap<String,String> customHeaders, FlagsmithLogger logger, String apiKey)
cache - cache objectdefaultConfig - config objectcustomHeaders - custom headers listlogger - logger objectapiKey - api keypublic FlagsmithApiWrapper(FlagsmithConfig defaultConfig, HashMap<String,String> customHeaders, FlagsmithLogger logger, String apiKey)
defaultConfig - config objectcustomHeaders - custom headers listlogger - logger instanceapiKey - api keypublic FlagsmithApiWrapper(FlagsmithConfig defaultConfig, HashMap<String,String> customHeaders, FlagsmithLogger logger, String apiKey, RequestProcessor requestProcessor)
defaultConfig - config objectcustomHeaders - custom headers listlogger - logger instanceapiKey - api keyrequestProcessor - request processorpublic Flags getFeatureFlags(boolean doThrow)
getFeatureFlags in interface FlagsmithSdkdoThrow - - whether throw exception or notpublic Flags identifyUserWithTraits(String identifier, List<TraitModel> traits, boolean doThrow)
identifyUserWithTraits in interface FlagsmithSdkpublic EnvironmentModel getEnvironment()
getEnvironment in interface FlagsmithSdkpublic RequestProcessor getRequestor()
getRequestor in interface FlagsmithSdkpublic void setRequestor(RequestProcessor requestor)
public FlagsmithConfig getConfig()
getConfig in interface FlagsmithSdkpublic FlagsmithCache getCache()
getCache in interface FlagsmithSdkpublic FlagsmithLogger getLogger()
public okhttp3.Request newGetRequest(okhttp3.HttpUrl url)
newGetRequest in interface FlagsmithSdkurl - - URL to invokepublic okhttp3.Request newPostRequest(okhttp3.HttpUrl url,
okhttp3.RequestBody body)
newPostRequest in interface FlagsmithSdkurl - - URL to invokebody - - body to postpublic void close()
close in interface FlagsmithSdkCopyright © 2023. All rights reserved.