Class Resolver
java.lang.Object
dev.openfeature.contrib.providers.ofrep.internal.Resolver
Resolver class that interacts with the OFREP API to resolve feature flags.
-
Constructor Summary
ConstructorsConstructorDescriptionResolver(String baseUrl, com.google.common.collect.ImmutableMap<String, com.google.common.collect.ImmutableList<String>> headers, Duration requestTimeout, Duration connectTimeout, ProxySelector proxySelector, Executor executor) Constructs a Resolver with the specified base URL, headers, timeout, proxySelector and executor. -
Method Summary
Modifier and TypeMethodDescriptiondev.openfeature.sdk.ProviderEvaluation<Boolean> resolveBoolean(String key, Boolean defaultValue, dev.openfeature.sdk.EvaluationContext ctx) dev.openfeature.sdk.ProviderEvaluation<Double> resolveDouble(String key, Double defaultValue, dev.openfeature.sdk.EvaluationContext ctx) dev.openfeature.sdk.ProviderEvaluation<Integer> resolveInteger(String key, Integer defaultValue, dev.openfeature.sdk.EvaluationContext ctx) dev.openfeature.sdk.ProviderEvaluation<dev.openfeature.sdk.Value> resolveObject(String key, dev.openfeature.sdk.Value defaultValue, dev.openfeature.sdk.EvaluationContext ctx) Resolves an object value for the given key.dev.openfeature.sdk.ProviderEvaluation<String> resolveString(String key, String defaultValue, dev.openfeature.sdk.EvaluationContext ctx)
-
Constructor Details
-
Resolver
public Resolver(String baseUrl, com.google.common.collect.ImmutableMap<String, com.google.common.collect.ImmutableList<String>> headers, Duration requestTimeout, Duration connectTimeout, ProxySelector proxySelector, Executor executor) Constructs a Resolver with the specified base URL, headers, timeout, proxySelector and executor.- Parameters:
baseUrl- - The base URL of the OFREP server.headers- - The headers to include in the requests.requestTimeout- - The request timeout duration for the request.connectTimeout- - The connect timeout duration for establishing the HTTP connection.proxySelector- - The ProxySelector to use for HTTP requests.executor- - The Executor to use for operations.
-
-
Method Details
-
resolveBoolean
-
resolveString
-
resolveInteger
-
resolveDouble
-
resolveObject
public dev.openfeature.sdk.ProviderEvaluation<dev.openfeature.sdk.Value> resolveObject(String key, dev.openfeature.sdk.Value defaultValue, dev.openfeature.sdk.EvaluationContext ctx) Resolves an object value for the given key.- Parameters:
key- - The flag key to evaluate.defaultValue- - The default value to return if there is an error.ctx- - The evaluation context containing additional information.- Returns:
- A ProviderEvaluation containing the resolved value, variant, reason, and metadata.
-