-
- All Implemented Interfaces:
-
java.io.Closeable,java.lang.AutoCloseable
public interface ConfigurationProvider implements Closeable
Defines the public interface of the ConfigCatClient.
-
-
Method Summary
Modifier and Type Method Description abstract <T> TgetValue(Class<T> classOfT, String key, T defaultValue)Gets the value of a feature flag or setting as T identified by the given {@code key}.abstract <T> TgetValue(Class<T> classOfT, String key, User user, T defaultValue)Gets the value of a feature flag or setting as T identified by the given {@code key}.abstract <T> CompletableFuture<T>getValueAsync(Class<T> classOfT, String key, T defaultValue)Gets the value of a feature flag or setting as T asynchronously identified by the given {@code key}.abstract <T> CompletableFuture<T>getValueAsync(Class<T> classOfT, String key, User user, T defaultValue)Gets the value of a feature flag or setting as T asynchronously identified by the given {@code key}.abstract <T> EvaluationDetails<T>getValueDetails(Class<T> classOfT, String key, T defaultValue)Gets the value of a feature flag or setting as T identified by the given {@code key}.abstract <T> EvaluationDetails<T>getValueDetails(Class<T> classOfT, String key, User user, T defaultValue)Gets the value of a feature flag or setting as T identified by the given {@code key}.abstract <T> CompletableFuture<EvaluationDetails<T>>getValueDetailsAsync(Class<T> classOfT, String key, T defaultValue)Gets the value of a feature flag or setting as T asynchronously identified by the given {@code key}.abstract <T> CompletableFuture<EvaluationDetails<T>>getValueDetailsAsync(Class<T> classOfT, String key, User user, T defaultValue)Gets the value of a feature flag or setting as T asynchronously identified by the given {@code key}.abstract Map<String, Object>getAllValues()Gets the values of all feature flags or settings synchronously. abstract Map<String, Object>getAllValues(User user)Gets the values of all feature flags or settings synchronously. abstract CompletableFuture<Map<String, Object>>getAllValuesAsync()Gets the values of all feature flags or settings asynchronously. abstract CompletableFuture<Map<String, Object>>getAllValuesAsync(User user)Gets the values of all feature flags or settings asynchronously. abstract List<EvaluationDetails<out Object>>getAllValueDetails()Gets the detailed values of all feature flags or settings synchronously. abstract List<EvaluationDetails<out Object>>getAllValueDetails(User user)Gets the detailed values of all feature flags or settings synchronously. abstract CompletableFuture<List<EvaluationDetails<out Object>>>getAllValueDetailsAsync()Gets the detailed values of all feature flags or settings asynchronously. abstract CompletableFuture<List<EvaluationDetails<out Object>>>getAllValueDetailsAsync(User user)Gets the detailed values of all feature flags or settings asynchronously. abstract <T> Map.Entry<String, T>getKeyAndValue(Class<T> classOfT, String variationId)Gets the key of a setting and its value identified by the given Variation ID (analytics). abstract <T> CompletableFuture<Map.Entry<String, T>>getKeyAndValueAsync(Class<T> classOfT, String variationId)Gets the key of a setting and its value identified by the given Variation ID (analytics). abstract Collection<String>getAllKeys()Gets a collection of all setting keys. abstract CompletableFuture<Collection<String>>getAllKeysAsync()Gets a collection of all setting keys asynchronously. abstract RefreshResultforceRefresh()Initiates a force refresh synchronously on the cached configuration. abstract CompletableFuture<RefreshResult>forceRefreshAsync()Initiates a force refresh asynchronously on the cached configuration. abstract voidsetDefaultUser(User user)Sets the default user. abstract voidclearDefaultUser()Sets the default user to null. abstract voidsetOnline()Configures the SDK to allow HTTP requests. abstract voidsetOffline()Configures the SDK to not initiate HTTP requests and work only from its cache. abstract booleanisOffline()Indicates whether the SDK is in offline mode or not. abstract ConfigCatHooksgetHooks()Access to hooks for event subscription. abstract booleanisClosed()Get the client closed status. -
-
Method Detail
-
getValue
abstract <T> T getValue(Class<T> classOfT, String key, T defaultValue)
Gets the value of a feature flag or setting as T identified by the given
{@code key}.- Parameters:
classOfT- the class of T.key- the identifier of a feature flag or setting.defaultValue- in case of any failure, this value will be returned.
-
getValue
abstract <T> T getValue(Class<T> classOfT, String key, User user, T defaultValue)
Gets the value of a feature flag or setting as T identified by the given
{@code key}.- Parameters:
classOfT- the class of T.key- the identifier of a feature flag or setting.user- the user object.defaultValue- in case of any failure, this value will be returned.
-
getValueAsync
abstract <T> CompletableFuture<T> getValueAsync(Class<T> classOfT, String key, T defaultValue)
Gets the value of a feature flag or setting as T asynchronously identified by the given
{@code key}.- Parameters:
classOfT- the class of T.key- the identifier of a feature flag or setting.defaultValue- in case of any failure, this value will be returned.
-
getValueAsync
abstract <T> CompletableFuture<T> getValueAsync(Class<T> classOfT, String key, User user, T defaultValue)
Gets the value of a feature flag or setting as T asynchronously identified by the given
{@code key}.- Parameters:
classOfT- the class of T.key- the identifier of a feature flag or setting.user- the user object.defaultValue- in case of any failure, this value will be returned.
-
getValueDetails
abstract <T> EvaluationDetails<T> getValueDetails(Class<T> classOfT, String key, T defaultValue)
Gets the value of a feature flag or setting as T identified by the given
{@code key}.- Parameters:
classOfT- the class of T.key- the identifier of a feature flag or setting.defaultValue- in case of any failure, this value will be returned.
-
getValueDetails
abstract <T> EvaluationDetails<T> getValueDetails(Class<T> classOfT, String key, User user, T defaultValue)
Gets the value of a feature flag or setting as T identified by the given
{@code key}.- Parameters:
classOfT- the class of T.key- the identifier of a feature flag or setting.user- the user object.defaultValue- in case of any failure, this value will be returned.
-
getValueDetailsAsync
abstract <T> CompletableFuture<EvaluationDetails<T>> getValueDetailsAsync(Class<T> classOfT, String key, T defaultValue)
Gets the value of a feature flag or setting as T asynchronously identified by the given
{@code key}.- Parameters:
classOfT- the class of T.key- the identifier of a feature flag or setting.defaultValue- in case of any failure, this value will be returned.
-
getValueDetailsAsync
abstract <T> CompletableFuture<EvaluationDetails<T>> getValueDetailsAsync(Class<T> classOfT, String key, User user, T defaultValue)
Gets the value of a feature flag or setting as T asynchronously identified by the given
{@code key}.- Parameters:
classOfT- the class of T.key- the identifier of a feature flag or setting.user- the user object.defaultValue- in case of any failure, this value will be returned.
-
getAllValues
abstract Map<String, Object> getAllValues()
Gets the values of all feature flags or settings synchronously.
-
getAllValues
abstract Map<String, Object> getAllValues(User user)
Gets the values of all feature flags or settings synchronously.
- Parameters:
user- the user object.
-
getAllValuesAsync
abstract CompletableFuture<Map<String, Object>> getAllValuesAsync()
Gets the values of all feature flags or settings asynchronously.
-
getAllValuesAsync
abstract CompletableFuture<Map<String, Object>> getAllValuesAsync(User user)
Gets the values of all feature flags or settings asynchronously.
- Parameters:
user- the user object.
-
getAllValueDetails
abstract List<EvaluationDetails<out Object>> getAllValueDetails()
Gets the detailed values of all feature flags or settings synchronously.
-
getAllValueDetails
abstract List<EvaluationDetails<out Object>> getAllValueDetails(User user)
Gets the detailed values of all feature flags or settings synchronously.
- Parameters:
user- the user object.
-
getAllValueDetailsAsync
abstract CompletableFuture<List<EvaluationDetails<out Object>>> getAllValueDetailsAsync()
Gets the detailed values of all feature flags or settings asynchronously.
-
getAllValueDetailsAsync
abstract CompletableFuture<List<EvaluationDetails<out Object>>> getAllValueDetailsAsync(User user)
Gets the detailed values of all feature flags or settings asynchronously.
- Parameters:
user- the user object.
-
getKeyAndValue
abstract <T> Map.Entry<String, T> getKeyAndValue(Class<T> classOfT, String variationId)
Gets the key of a setting and its value identified by the given Variation ID (analytics).
- Parameters:
classOfT- the class of T.variationId- the Variation ID.
-
getKeyAndValueAsync
abstract <T> CompletableFuture<Map.Entry<String, T>> getKeyAndValueAsync(Class<T> classOfT, String variationId)
Gets the key of a setting and its value identified by the given Variation ID (analytics).
- Parameters:
classOfT- the class of T.variationId- the Variation ID.
-
getAllKeys
abstract Collection<String> getAllKeys()
Gets a collection of all setting keys.
-
getAllKeysAsync
abstract CompletableFuture<Collection<String>> getAllKeysAsync()
Gets a collection of all setting keys asynchronously.
-
forceRefresh
abstract RefreshResult forceRefresh()
Initiates a force refresh synchronously on the cached configuration.
-
forceRefreshAsync
abstract CompletableFuture<RefreshResult> forceRefreshAsync()
Initiates a force refresh asynchronously on the cached configuration.
-
setDefaultUser
abstract void setDefaultUser(User user)
Sets the default user.
- Parameters:
user- the default user.
-
clearDefaultUser
abstract void clearDefaultUser()
Sets the default user to null.
-
setOnline
abstract void setOnline()
Configures the SDK to allow HTTP requests.
-
setOffline
abstract void setOffline()
Configures the SDK to not initiate HTTP requests and work only from its cache.
-
isOffline
abstract boolean isOffline()
Indicates whether the SDK is in offline mode or not.
-
getHooks
abstract ConfigCatHooks getHooks()
Access to hooks for event subscription.
-
isClosed
abstract boolean isClosed()
Get the client closed status.
-
-
-
-