Skip to content

Commit 528a536

Browse files
update: add overloaded constructor to DecisionService for improved initialization
1 parent 97fd046 commit 528a536

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

core-api/src/main/java/com/optimizely/ab/bucketing/DecisionService.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,18 @@ public class DecisionService {
7878
*/
7979
private transient ConcurrentHashMap<String, ConcurrentHashMap<String, String>> forcedVariationMapping = new ConcurrentHashMap<String, ConcurrentHashMap<String, String>>();
8080

81+
/**
82+
* Initialize a decision service for the Optimizely client.
83+
*
84+
* @param bucketer Base bucketer to allocate new users to an experiment.
85+
* @param errorHandler The error handler of the Optimizely client.
86+
* @param userProfileService UserProfileService implementation for storing user info.
87+
*/
88+
public DecisionService(@Nonnull Bucketer bucketer,
89+
@Nonnull ErrorHandler errorHandler,
90+
@Nullable UserProfileService userProfileService) {
91+
this(bucketer, errorHandler, userProfileService, null);
92+
}
8193

8294
/**
8395
* Initialize a decision service for the Optimizely client.
@@ -90,7 +102,7 @@ public class DecisionService {
90102
public DecisionService(@Nonnull Bucketer bucketer,
91103
@Nonnull ErrorHandler errorHandler,
92104
@Nullable UserProfileService userProfileService,
93-
@Nonnull CmabService cmabService) {
105+
@Nullable CmabService cmabService) {
94106
this.bucketer = bucketer;
95107
this.errorHandler = errorHandler;
96108
this.userProfileService = userProfileService;

0 commit comments

Comments
 (0)