Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save amanjeetsingh150/7810e3c08c58d0878b884d66edc7f28a to your computer and use it in GitHub Desktop.
Save amanjeetsingh150/7810e3c08c58d0878b884d66edc7f28a to your computer and use it in GitHub Desktop.
public static final class Builder {
/**Other code**/
public ActivityComponent build() {
if (activityModule == null) {
throw new IllegalStateException(ActivityModule.class.getCanonicalName() + " must be set");
}
if (appComponent == null) {
throw new IllegalStateException(AppComponent.class.getCanonicalName() + " must be set");
}
return new DaggerActivityComponent(this);
}
public Builder activityModule(ActivityModule activityModule) {
this.activityModule = Preconditions.checkNotNull(activityModule);
return this;
}
public Builder appComponent(AppComponent appComponent) {
this.appComponent = Preconditions.checkNotNull(appComponent);
return this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment