-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feature flagging and tests on client * remove uneeded line * remove getEnabledFeatureFlags method * add tests for parsing and break down enabled flag tests * add should parse counters and feature flag tests * move setCounters and setFeatureFlags out of parse methods * remove unneeded comments * remove unneeded comments * redefine HashSet as Set, add one test, featureFlagManager and countAggregator package private, loop returns set instead of list
- Loading branch information
Showing
8 changed files
with
219 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
AndroidSDKCore/src/main/java/com/leanplum/internal/FeatureFlagManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.leanplum.internal; | ||
|
||
import android.support.annotation.VisibleForTesting; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
public class FeatureFlagManager { | ||
public static final FeatureFlagManager INSTANCE = new FeatureFlagManager(); | ||
|
||
private Set<String> enabledFeatureFlags = new HashSet<>(); | ||
|
||
@VisibleForTesting | ||
FeatureFlagManager() { | ||
super(); | ||
} | ||
|
||
public void setEnabledFeatureFlags(Set<String> enabledFeatureFlags) { | ||
this.enabledFeatureFlags = enabledFeatureFlags; | ||
} | ||
|
||
public Boolean isFeatureFlagEnabled(String featureFlagName) { | ||
return this.enabledFeatureFlags.contains(featureFlagName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.