Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions core-api/src/main/java/com/optimizely/ab/Optimizely.java
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,22 @@ public <T> int addNotificationHandler(Class<T> clazz, NotificationHandler<T> han
}

//======== Builder ========//

/**
* This overloaded factory method is deprecated in favor of pure builder methods.
* Please use {@link com.optimizely.ab.Optimizely#builder()} along with
* {@link Builder#withDatafile(java.lang.String)} and
* {@link Builder#withEventHandler(com.optimizely.ab.event.EventHandler)}
* respectively.
*
* Example:
* <pre>
* Optimizely optimizely = Optimizely.builder()
* .withDatafile(datafile)
* .withEventHandler(eventHandler)
* .build();
* </pre>
*/
@Deprecated
public static Builder builder(@Nonnull String datafile,
@Nonnull EventHandler eventHandler) {
Expand Down Expand Up @@ -1054,12 +1070,12 @@ public Builder withNotificationCenter(NotificationCenter notificationCenter) {
return this;
}

// Helper function for making testing easier
protected Builder withDatafile(String datafile) {
public Builder withDatafile(String datafile) {
this.datafile = datafile;
return this;
}

// Helper functions for making testing easier
protected Builder withBucketing(Bucketer bucketer) {
this.bucketer = bucketer;
return this;
Expand Down