11package dev .openfeature .sdk ;
22
3- import dev .openfeature .sdk .exceptions .*;
3+ import dev .openfeature .sdk .exceptions .ExceptionUtils ;
4+ import dev .openfeature .sdk .exceptions .FatalError ;
5+ import dev .openfeature .sdk .exceptions .GeneralError ;
6+ import dev .openfeature .sdk .exceptions .OpenFeatureError ;
7+ import dev .openfeature .sdk .exceptions .ProviderNotReadyError ;
48import dev .openfeature .sdk .internal .AutoCloseableLock ;
59import dev .openfeature .sdk .internal .AutoCloseableReentrantReadWriteLock ;
610import dev .openfeature .sdk .internal .ObjectUtils ;
11+ import java .util .ArrayList ;
12+ import java .util .Arrays ;
13+ import java .util .Collections ;
14+ import java .util .List ;
15+ import java .util .Map ;
16+ import java .util .function .Consumer ;
717import lombok .Getter ;
818import lombok .extern .slf4j .Slf4j ;
919
10- import java .util .*;
11- import java .util .function .Consumer ;
12-
1320/**
1421 * OpenFeature Client implementation.
1522 * You should not instantiate this or reference this class.
@@ -42,8 +49,8 @@ public class OpenFeatureClient implements Client {
4249 * @param domain An identifier which logically binds clients with providers (used by observability tools).
4350 * @param version Version of the client (used by observability tools).
4451 * @deprecated Do not use this constructor. It's for internal use only.
45- * Clients created using it will not run event handlers.
46- * Use the OpenFeatureAPI's getClient factory method instead.
52+ * Clients created using it will not run event handlers.
53+ * Use the OpenFeatureAPI's getClient factory method instead.
4754 */
4855 @ Deprecated () // TODO: eventually we will make this non-public. See issue #872
4956 public OpenFeatureClient (
@@ -106,7 +113,7 @@ public EvaluationContext getEvaluationContext() {
106113 }
107114
108115 private <T > FlagEvaluationDetails <T > evaluateFlag (FlagValueType type , String key , T defaultValue ,
109- EvaluationContext ctx , FlagEvaluationOptions options ) {
116+ EvaluationContext ctx , FlagEvaluationOptions options ) {
110117 FlagEvaluationOptions flagOptions = ObjectUtils .defaultIfNull (options ,
111118 () -> FlagEvaluationOptions .builder ().build ());
112119 Map <String , Object > hints = Collections .unmodifiableMap (flagOptions .getHookHints ());
@@ -230,7 +237,7 @@ public Boolean getBooleanValue(String key, Boolean defaultValue, EvaluationConte
230237
231238 @ Override
232239 public Boolean getBooleanValue (String key , Boolean defaultValue , EvaluationContext ctx ,
233- FlagEvaluationOptions options ) {
240+ FlagEvaluationOptions options ) {
234241 return getBooleanDetails (key , defaultValue , ctx , options ).getValue ();
235242 }
236243
@@ -246,7 +253,7 @@ public FlagEvaluationDetails<Boolean> getBooleanDetails(String key, Boolean defa
246253
247254 @ Override
248255 public FlagEvaluationDetails <Boolean > getBooleanDetails (String key , Boolean defaultValue , EvaluationContext ctx ,
249- FlagEvaluationOptions options ) {
256+ FlagEvaluationOptions options ) {
250257 return this .evaluateFlag (FlagValueType .BOOLEAN , key , defaultValue , ctx , options );
251258 }
252259
@@ -262,7 +269,7 @@ public String getStringValue(String key, String defaultValue, EvaluationContext
262269
263270 @ Override
264271 public String getStringValue (String key , String defaultValue , EvaluationContext ctx ,
265- FlagEvaluationOptions options ) {
272+ FlagEvaluationOptions options ) {
266273 return getStringDetails (key , defaultValue , ctx , options ).getValue ();
267274 }
268275
@@ -278,7 +285,7 @@ public FlagEvaluationDetails<String> getStringDetails(String key, String default
278285
279286 @ Override
280287 public FlagEvaluationDetails <String > getStringDetails (String key , String defaultValue , EvaluationContext ctx ,
281- FlagEvaluationOptions options ) {
288+ FlagEvaluationOptions options ) {
282289 return this .evaluateFlag (FlagValueType .STRING , key , defaultValue , ctx , options );
283290 }
284291
@@ -294,7 +301,7 @@ public Integer getIntegerValue(String key, Integer defaultValue, EvaluationConte
294301
295302 @ Override
296303 public Integer getIntegerValue (String key , Integer defaultValue , EvaluationContext ctx ,
297- FlagEvaluationOptions options ) {
304+ FlagEvaluationOptions options ) {
298305 return getIntegerDetails (key , defaultValue , ctx , options ).getValue ();
299306 }
300307
@@ -310,7 +317,7 @@ public FlagEvaluationDetails<Integer> getIntegerDetails(String key, Integer defa
310317
311318 @ Override
312319 public FlagEvaluationDetails <Integer > getIntegerDetails (String key , Integer defaultValue , EvaluationContext ctx ,
313- FlagEvaluationOptions options ) {
320+ FlagEvaluationOptions options ) {
314321 return this .evaluateFlag (FlagValueType .INTEGER , key , defaultValue , ctx , options );
315322 }
316323
@@ -326,7 +333,7 @@ public Double getDoubleValue(String key, Double defaultValue, EvaluationContext
326333
327334 @ Override
328335 public Double getDoubleValue (String key , Double defaultValue , EvaluationContext ctx ,
329- FlagEvaluationOptions options ) {
336+ FlagEvaluationOptions options ) {
330337 return this .evaluateFlag (FlagValueType .DOUBLE , key , defaultValue , ctx , options ).getValue ();
331338 }
332339
@@ -342,7 +349,7 @@ public FlagEvaluationDetails<Double> getDoubleDetails(String key, Double default
342349
343350 @ Override
344351 public FlagEvaluationDetails <Double > getDoubleDetails (String key , Double defaultValue , EvaluationContext ctx ,
345- FlagEvaluationOptions options ) {
352+ FlagEvaluationOptions options ) {
346353 return this .evaluateFlag (FlagValueType .DOUBLE , key , defaultValue , ctx , options );
347354 }
348355
@@ -358,7 +365,7 @@ public Value getObjectValue(String key, Value defaultValue, EvaluationContext ct
358365
359366 @ Override
360367 public Value getObjectValue (String key , Value defaultValue , EvaluationContext ctx ,
361- FlagEvaluationOptions options ) {
368+ FlagEvaluationOptions options ) {
362369 return getObjectDetails (key , defaultValue , ctx , options ).getValue ();
363370 }
364371
@@ -369,13 +376,13 @@ public FlagEvaluationDetails<Value> getObjectDetails(String key, Value defaultVa
369376
370377 @ Override
371378 public FlagEvaluationDetails <Value > getObjectDetails (String key , Value defaultValue ,
372- EvaluationContext ctx ) {
379+ EvaluationContext ctx ) {
373380 return getObjectDetails (key , defaultValue , ctx , FlagEvaluationOptions .builder ().build ());
374381 }
375382
376383 @ Override
377384 public FlagEvaluationDetails <Value > getObjectDetails (String key , Value defaultValue , EvaluationContext ctx ,
378- FlagEvaluationOptions options ) {
385+ FlagEvaluationOptions options ) {
379386 return this .evaluateFlag (FlagValueType .OBJECT , key , defaultValue , ctx , options );
380387 }
381388
0 commit comments