Skip to content

Commit 38b060a

Browse files
author
Vignesh Raja
authored
Change 'getVariableFloat' to 'getVariableDouble' (#75)
1 parent 5e2c909 commit 38b060a

File tree

3 files changed

+24
-23
lines changed

3 files changed

+24
-23
lines changed

android-sdk/src/main/java/com/optimizely/ab/android/sdk/OptimizelyClient.java

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -276,33 +276,34 @@ public void track(@NonNull String eventName,
276276
}
277277

278278
/**
279-
* Get the value of a Float live variable
279+
* Get the value of a Double live variable
280280
* @param variableKey the String key for the variable
281281
* @param userId the user ID
282282
* @param activateExperiment the flag denoting whether to activate an experiment or not
283-
* @return Float value of the live variable
283+
* @return Double value of the live variable
284284
*/
285-
public @Nullable Float getVariableFloat(@NonNull String variableKey,
286-
@NonNull String userId,
287-
boolean activateExperiment) {
288-
return getVariableFloat(variableKey, userId, Collections.<String, String>emptyMap(),
289-
activateExperiment);
285+
public @Nullable Double getVariableDouble(@NonNull String variableKey,
286+
@NonNull String userId,
287+
boolean activateExperiment) {
288+
return getVariableDouble(variableKey, userId, Collections.<String, String>emptyMap(),
289+
activateExperiment);
290290
}
291291

292292
/**
293-
* Get the value of a Float live variable
293+
* Get the value of a Double live variable
294294
* @param variableKey the String key for the variable
295295
* @param userId the user ID
296296
* @param attributes a map of attributes about the user
297297
* @param activateExperiment the flag denoting whether to activate an experiment or not
298-
* @return Float value of the live variable
298+
* @return Double value of the live variable
299299
*/
300-
public @Nullable Float getVariableFloat(@NonNull String variableKey,
301-
@NonNull String userId,
302-
@NonNull Map<String, String> attributes,
303-
boolean activateExperiment) {
300+
public @Nullable Double getVariableDouble(@NonNull String variableKey,
301+
@NonNull String userId,
302+
@NonNull Map<String, String> attributes,
303+
boolean activateExperiment) {
304304
if (optimizely != null) {
305-
return optimizely.getVariableFloat(variableKey, userId, attributes, activateExperiment);
305+
return optimizely.getVariableDouble(variableKey, userId, attributes,
306+
activateExperiment);
306307
} else {
307308
logger.warn("Optimizely is not initialized, could not get live variable {} " +
308309
"for user {}", variableKey, userId);

android-sdk/src/test/java/com/optimizely/ab/android/sdk/OptimizelyClientTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,19 +238,19 @@ public void testBadGetVariableInteger() {
238238
}
239239

240240
@Test
241-
public void testGoodGetVariableFloat() {
241+
public void testGoodGetVariableDouble() {
242242
OptimizelyClient optimizelyClient = new OptimizelyClient(optimizely, logger);
243-
optimizelyClient.getVariableFloat("test_key", "userId",
244-
Collections.<String, String>emptyMap(), true);
245-
verify(optimizely).getVariableFloat("test_key", "userId",
246-
Collections.<String, String>emptyMap(), true);
243+
optimizelyClient.getVariableDouble("test_key", "userId",
244+
Collections.<String, String>emptyMap(), true);
245+
verify(optimizely).getVariableDouble("test_key", "userId",
246+
Collections.<String, String>emptyMap(), true);
247247
}
248248

249249
@Test
250-
public void testBadGetVariableFloat() {
250+
public void testBadGetVariableDouble() {
251251
OptimizelyClient optimizelyClient = new OptimizelyClient(null, logger);
252-
optimizelyClient.getVariableFloat("test_key", "userId",
253-
Collections.<String, String>emptyMap(), true);
252+
optimizelyClient.getVariableDouble("test_key", "userId",
253+
Collections.<String, String>emptyMap(), true);
254254
verify(logger).warn("Optimizely is not initialized, could not get live variable {} " +
255255
"for user {}", "test_key", "userId");
256256
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ext {
5252
min_sdk_version = 10
5353
target_sdk_version = 24
5454

55-
java_core_ver = "1.2.0"
55+
java_core_ver = "1.3.0"
5656
android_logger_ver = "1.3.1"
5757
support_annotations_ver = "24.2.1"
5858
junit_ver = "4.12"

0 commit comments

Comments
 (0)