// Generated by dagger.internal.codegen.ComponentProcessor (https://google.github.io/dagger).
package com.example.dagger2_20210703;

import com.example.dagger2_20210703.di.Presenter;
import com.example.dagger2_20210703.di.PresenterComponent;
import com.example.dagger2_20210703.object.DatabaseObject;
import com.example.dagger2_20210703.object.HttpObject;
import dagger.MembersInjector;
import dagger.internal.DoubleCheck;
import dagger.internal.Factory;
import dagger.internal.Preconditions;
import javax.inject.Provider;

public final class DaggerMyComponent implements MyComponent {
  private Provider<HttpObject> providerHttpObjectProvider;

  private Provider<DatabaseObject> providerDatabaseObjectProvider;

  private Provider<Presenter> providerPresenterProvider;

  private MembersInjector<MainActivity> mainActivityMembersInjector;

  private MembersInjector<SecActivity> secActivityMembersInjector;

  private DaggerMyComponent(Builder builder) {
    assert builder != null;
    initialize(builder);
  }

  public static Builder builder() {
    return new Builder();
  }

  @SuppressWarnings("unchecked")
  private void initialize(final Builder builder) {

    this.providerHttpObjectProvider =
        DoubleCheck.provider(HttpModule_ProviderHttpObjectFactory.create(builder.httpModule));

    this.providerDatabaseObjectProvider =
        DatabaseModule_ProviderDatabaseObjectFactory.create(builder.databaseModule);

    this.providerPresenterProvider =
        new Factory<Presenter>() {
          private final PresenterComponent presenterComponent = builder.presenterComponent;

          @Override
          public Presenter get() {
            return Preconditions.checkNotNull(
                presenterComponent.providerPresenter(),
                "Cannot return null from a non-@Nullable component method");
          }
        };

    this.mainActivityMembersInjector =
        MainActivity_MembersInjector.create(
            providerHttpObjectProvider, providerDatabaseObjectProvider, providerPresenterProvider);

    this.secActivityMembersInjector =
        SecActivity_MembersInjector.create(providerHttpObjectProvider, providerPresenterProvider);
  }

  @Override
  public void injectMainActivity(MainActivity mainActivity) {
    mainActivityMembersInjector.injectMembers(mainActivity);
  }

  @Override
  public void injectSecActivity(SecActivity secActivity) {
    secActivityMembersInjector.injectMembers(secActivity);
  }

  public static final class Builder {
    private HttpModule httpModule;

    private DatabaseModule databaseModule;

    private PresenterComponent presenterComponent;

    private Builder() {}

    public MyComponent build() {
      if (httpModule == null) {
        this.httpModule = new HttpModule();
      }
      if (databaseModule == null) {
        this.databaseModule = new DatabaseModule();
      }
      if (presenterComponent == null) {
        throw new IllegalStateException(
            PresenterComponent.class.getCanonicalName() + " must be set");
      }
      return new DaggerMyComponent(this);
    }

    public Builder httpModule(HttpModule httpModule) {
      this.httpModule = Preconditions.checkNotNull(httpModule);
      return this;
    }

    public Builder databaseModule(DatabaseModule databaseModule) {
      this.databaseModule = Preconditions.checkNotNull(databaseModule);
      return this;
    }

    public Builder presenterComponent(PresenterComponent presenterComponent) {
      this.presenterComponent = Preconditions.checkNotNull(presenterComponent);
      return this;
    }
  }
}
