2323import com .optimizely .ab .config .EventType ;
2424import com .optimizely .ab .config .Experiment ;
2525import com .optimizely .ab .config .FeatureFlag ;
26- import com .optimizely .ab .config .LiveVariable ;
27- import com .optimizely .ab .config .LiveVariableUsageInstance ;
26+ import com .optimizely .ab .config .FeatureVariable ;
27+ import com .optimizely .ab .config .FeatureVariableUsageInstance ;
2828import com .optimizely .ab .config .ProjectConfig ;
2929import com .optimizely .ab .config .Variation ;
3030import com .optimizely .ab .config .parser .ConfigParseException ;
@@ -203,9 +203,9 @@ public Variation activate(@Nonnull Experiment experiment,
203203
204204 @ Nullable
205205 private Variation activate (@ Nonnull ProjectConfig projectConfig ,
206- @ Nonnull Experiment experiment ,
207- @ Nonnull String userId ,
208- @ Nonnull Map <String , ?> attributes ) {
206+ @ Nonnull Experiment experiment ,
207+ @ Nonnull String userId ,
208+ @ Nonnull Map <String , ?> attributes ) {
209209 if (!isValid ) {
210210 logger .error ("Optimizely instance is not valid, failing activate call." );
211211 return null ;
@@ -310,12 +310,12 @@ public void track(@Nonnull String eventName,
310310
311311 // create the conversion event request parameters, then dispatch
312312 LogEvent conversionEvent = eventFactory .createConversionEvent (
313- projectConfig ,
314- userId ,
315- eventType .getId (),
316- eventType .getKey (),
317- copiedAttributes ,
318- eventTags );
313+ projectConfig ,
314+ userId ,
315+ eventType .getId (),
316+ eventType .getKey (),
317+ copiedAttributes ,
318+ eventTags );
319319
320320 logger .info ("Tracking event \" {}\" for user \" {}\" ." , eventName , userId );
321321
@@ -348,7 +348,7 @@ public void track(@Nonnull String eventName,
348348 */
349349 @ Nonnull
350350 public Boolean isFeatureEnabled (@ Nonnull String featureKey ,
351- @ Nonnull String userId ) {
351+ @ Nonnull String userId ) {
352352 return isFeatureEnabled (featureKey , userId , Collections .<String , String >emptyMap ());
353353 }
354354
@@ -365,8 +365,8 @@ public Boolean isFeatureEnabled(@Nonnull String featureKey,
365365 */
366366 @ Nonnull
367367 public Boolean isFeatureEnabled (@ Nonnull String featureKey ,
368- @ Nonnull String userId ,
369- @ Nonnull Map <String , ?> attributes ) {
368+ @ Nonnull String userId ,
369+ @ Nonnull Map <String , ?> attributes ) {
370370 if (!isValid ) {
371371 logger .error ("Optimizely instance is not valid, failing isFeatureEnabled call." );
372372 return false ;
@@ -451,7 +451,7 @@ public Boolean getFeatureVariableBoolean(@Nonnull String featureKey,
451451 variableKey ,
452452 userId ,
453453 attributes ,
454- LiveVariable .VariableType .BOOLEAN
454+ FeatureVariable .VariableType .BOOLEAN
455455 );
456456 if (variableValue != null ) {
457457 return Boolean .parseBoolean (variableValue );
@@ -500,7 +500,7 @@ public Double getFeatureVariableDouble(@Nonnull String featureKey,
500500 variableKey ,
501501 userId ,
502502 attributes ,
503- LiveVariable .VariableType .DOUBLE
503+ FeatureVariable .VariableType .DOUBLE
504504 );
505505 if (variableValue != null ) {
506506 try {
@@ -554,7 +554,7 @@ public Integer getFeatureVariableInteger(@Nonnull String featureKey,
554554 variableKey ,
555555 userId ,
556556 attributes ,
557- LiveVariable .VariableType .INTEGER
557+ FeatureVariable .VariableType .INTEGER
558558 );
559559 if (variableValue != null ) {
560560 try {
@@ -608,15 +608,15 @@ public String getFeatureVariableString(@Nonnull String featureKey,
608608 variableKey ,
609609 userId ,
610610 attributes ,
611- LiveVariable .VariableType .STRING );
611+ FeatureVariable .VariableType .STRING );
612612 }
613613
614614 @ VisibleForTesting
615615 String getFeatureVariableValueForType (@ Nonnull String featureKey ,
616616 @ Nonnull String variableKey ,
617617 @ Nonnull String userId ,
618618 @ Nonnull Map <String , ?> attributes ,
619- @ Nonnull LiveVariable .VariableType variableType ) {
619+ @ Nonnull FeatureVariable .VariableType variableType ) {
620620 if (featureKey == null ) {
621621 logger .warn ("The featureKey parameter must be nonnull." );
622622 return null ;
@@ -633,7 +633,7 @@ String getFeatureVariableValueForType(@Nonnull String featureKey,
633633 return null ;
634634 }
635635
636- LiveVariable variable = featureFlag .getVariableKeyToLiveVariableMap ().get (variableKey );
636+ FeatureVariable variable = featureFlag .getVariableKeyToFeatureVariableMap ().get (variableKey );
637637 if (variable == null ) {
638638 logger .info ("No feature variable was found for key \" {}\" in feature flag \" {}\" ." ,
639639 variableKey , featureKey );
@@ -650,10 +650,10 @@ String getFeatureVariableValueForType(@Nonnull String featureKey,
650650 Map <String , ?> copiedAttributes = copyAttributes (attributes );
651651 FeatureDecision featureDecision = decisionService .getVariationForFeature (featureFlag , userId , copiedAttributes );
652652 if (featureDecision .variation != null ) {
653- LiveVariableUsageInstance liveVariableUsageInstance =
654- featureDecision .variation .getVariableIdToLiveVariableUsageInstanceMap ().get (variable .getId ());
655- if (liveVariableUsageInstance != null ) {
656- variableValue = liveVariableUsageInstance .getValue ();
653+ FeatureVariableUsageInstance featureVariableUsageInstance =
654+ featureDecision .variation .getVariableIdToFeatureVariableUsageInstanceMap ().get (variable .getId ());
655+ if (featureVariableUsageInstance != null ) {
656+ variableValue = featureVariableUsageInstance .getValue ();
657657 } else {
658658 variableValue = variable .getDefaultValue ();
659659 }
0 commit comments