-
- All Implemented Interfaces:
-
dev.openfeature.sdk.FeatureProvider
public class NoOpProvider implements FeatureProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classNoOpProvider.NoOpProviderMetadata
-
Field Summary
Fields Modifier and Type Field Description private final ProviderMetadatametadataprivate final List<Hook<?>>hooks
-
Constructor Summary
Constructors Constructor Description NoOpProvider(List<Hook<?>> hooks)
-
Method Summary
Modifier and Type Method Description ProviderMetadatagetMetadata()List<Hook<?>>getHooks()Unitinitialize(EvaluationContext initialContext)Called by OpenFeatureAPI whenever the new Provider is registered This function should block until ready and throw exceptions if it fails to initialize Unitshutdown()Called when the lifecycle of the OpenFeatureClient is over to release resources/threads UnitonContextSet(EvaluationContext oldContext, EvaluationContext newContext)Called by OpenFeatureAPI whenever a new EvaluationContext is set by the application Perform blocking work here until the provider is ready again or throws an exception ProviderEvaluation<Boolean>getBooleanEvaluation(String key, Boolean defaultValue, EvaluationContext context)ProviderEvaluation<String>getStringEvaluation(String key, String defaultValue, EvaluationContext context)ProviderEvaluation<Integer>getIntegerEvaluation(String key, Integer defaultValue, EvaluationContext context)ProviderEvaluation<Double>getDoubleEvaluation(String key, Double defaultValue, EvaluationContext context)ProviderEvaluation<Value>getObjectEvaluation(String key, Value defaultValue, EvaluationContext context)-
-
Method Detail
-
getMetadata
ProviderMetadata getMetadata()
-
initialize
Unit initialize(EvaluationContext initialContext)
Called by OpenFeatureAPI whenever the new Provider is registered This function should block until ready and throw exceptions if it fails to initialize
- Parameters:
initialContext- any initial context to be set before the provider is ready
-
shutdown
Unit shutdown()
Called when the lifecycle of the OpenFeatureClient is over to release resources/threads
-
onContextSet
Unit onContextSet(EvaluationContext oldContext, EvaluationContext newContext)
Called by OpenFeatureAPI whenever a new EvaluationContext is set by the application Perform blocking work here until the provider is ready again or throws an exception
- Parameters:
oldContext- The old EvaluationContextnewContext- The new EvaluationContext
-
getBooleanEvaluation
ProviderEvaluation<Boolean> getBooleanEvaluation(String key, Boolean defaultValue, EvaluationContext context)
-
getStringEvaluation
ProviderEvaluation<String> getStringEvaluation(String key, String defaultValue, EvaluationContext context)
-
getIntegerEvaluation
ProviderEvaluation<Integer> getIntegerEvaluation(String key, Integer defaultValue, EvaluationContext context)
-
getDoubleEvaluation
ProviderEvaluation<Double> getDoubleEvaluation(String key, Double defaultValue, EvaluationContext context)
-
getObjectEvaluation
ProviderEvaluation<Value> getObjectEvaluation(String key, Value defaultValue, EvaluationContext context)
-
-
-
-