@@ -383,6 +383,16 @@ public void track(@Nonnull String eventName,
383
383
@ Nonnull String variableKey ,
384
384
@ Nonnull String userId ,
385
385
@ Nonnull Map <String , String > attributes ) {
386
+ String variableValue = getFeatureVariableValueForType (
387
+ featureKey ,
388
+ variableKey ,
389
+ userId ,
390
+ attributes ,
391
+ LiveVariable .VariableType .BOOLEAN
392
+ );
393
+ if (variableValue != null ) {
394
+ return Boolean .parseBoolean (variableValue );
395
+ }
386
396
return null ;
387
397
}
388
398
@@ -413,6 +423,22 @@ public void track(@Nonnull String eventName,
413
423
@ Nonnull String variableKey ,
414
424
@ Nonnull String userId ,
415
425
@ Nonnull Map <String , String > attributes ) {
426
+ String variableValue = getFeatureVariableValueForType (
427
+ featureKey ,
428
+ variableKey ,
429
+ userId ,
430
+ attributes ,
431
+ LiveVariable .VariableType .DOUBLE
432
+ );
433
+ if (variableValue != null ) {
434
+ try {
435
+ return Double .parseDouble (variableValue );
436
+ }
437
+ catch (NumberFormatException exception ) {
438
+ logger .error ("NumberFormatException while trying to parse \" " + variableValue +
439
+ "\" as Double. " + exception );
440
+ }
441
+ }
416
442
return null ;
417
443
}
418
444
@@ -443,6 +469,22 @@ public void track(@Nonnull String eventName,
443
469
@ Nonnull String variableKey ,
444
470
@ Nonnull String userId ,
445
471
@ Nonnull Map <String , String > attributes ) {
472
+ String variableValue = getFeatureVariableValueForType (
473
+ featureKey ,
474
+ variableKey ,
475
+ userId ,
476
+ attributes ,
477
+ LiveVariable .VariableType .INTEGER
478
+ );
479
+ if (variableValue != null ) {
480
+ try {
481
+ return Integer .parseInt (variableValue );
482
+ }
483
+ catch (NumberFormatException exception ) {
484
+ logger .error ("NumberFormatException while trying to parse \" " + variableValue +
485
+ "\" as Integer. " + exception .toString ());
486
+ }
487
+ }
446
488
return null ;
447
489
}
448
490
0 commit comments