All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dagger.android.processor.AutoValue_AndroidInjectorDescriptor Maven / Gradle / Ivy

There is a newer version: 2.52
Show newest version
package dagger.android.processor;

import com.google.common.collect.ImmutableSet;
import com.squareup.javapoet.AnnotationSpec;
import com.squareup.javapoet.ClassName;
import javax.lang.model.element.ExecutableElement;

// Generated by com.google.auto.value.processor.AutoValueProcessor
final class AutoValue_AndroidInjectorDescriptor extends AndroidInjectorDescriptor {

  private final ClassName injectedType;

  private final ImmutableSet scopes;

  private final ImmutableSet modules;

  private final ClassName enclosingModule;

  private final ExecutableElement method;

  private AutoValue_AndroidInjectorDescriptor(
      ClassName injectedType,
      ImmutableSet scopes,
      ImmutableSet modules,
      ClassName enclosingModule,
      ExecutableElement method) {
    this.injectedType = injectedType;
    this.scopes = scopes;
    this.modules = modules;
    this.enclosingModule = enclosingModule;
    this.method = method;
  }

  @Override
  ClassName injectedType() {
    return injectedType;
  }

  @Override
  ImmutableSet scopes() {
    return scopes;
  }

  @Override
  ImmutableSet modules() {
    return modules;
  }

  @Override
  ClassName enclosingModule() {
    return enclosingModule;
  }

  @Override
  ExecutableElement method() {
    return method;
  }

  @Override
  public String toString() {
    return "AndroidInjectorDescriptor{"
        + "injectedType=" + injectedType + ", "
        + "scopes=" + scopes + ", "
        + "modules=" + modules + ", "
        + "enclosingModule=" + enclosingModule + ", "
        + "method=" + method
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof AndroidInjectorDescriptor) {
      AndroidInjectorDescriptor that = (AndroidInjectorDescriptor) o;
      return this.injectedType.equals(that.injectedType())
          && this.scopes.equals(that.scopes())
          && this.modules.equals(that.modules())
          && this.enclosingModule.equals(that.enclosingModule())
          && this.method.equals(that.method());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= injectedType.hashCode();
    h$ *= 1000003;
    h$ ^= scopes.hashCode();
    h$ *= 1000003;
    h$ ^= modules.hashCode();
    h$ *= 1000003;
    h$ ^= enclosingModule.hashCode();
    h$ *= 1000003;
    h$ ^= method.hashCode();
    return h$;
  }

  static final class Builder extends AndroidInjectorDescriptor.Builder {
    private ClassName injectedType;
    private ImmutableSet.Builder scopesBuilder$;
    private ImmutableSet scopes;
    private ImmutableSet.Builder modulesBuilder$;
    private ImmutableSet modules;
    private ClassName enclosingModule;
    private ExecutableElement method;
    Builder() {
    }
    @Override
    AndroidInjectorDescriptor.Builder injectedType(ClassName injectedType) {
      if (injectedType == null) {
        throw new NullPointerException("Null injectedType");
      }
      this.injectedType = injectedType;
      return this;
    }
    @Override
    ImmutableSet.Builder scopesBuilder() {
      if (scopesBuilder$ == null) {
        scopesBuilder$ = ImmutableSet.builder();
      }
      return scopesBuilder$;
    }
    @Override
    ImmutableSet.Builder modulesBuilder() {
      if (modulesBuilder$ == null) {
        modulesBuilder$ = ImmutableSet.builder();
      }
      return modulesBuilder$;
    }
    @Override
    AndroidInjectorDescriptor.Builder enclosingModule(ClassName enclosingModule) {
      if (enclosingModule == null) {
        throw new NullPointerException("Null enclosingModule");
      }
      this.enclosingModule = enclosingModule;
      return this;
    }
    @Override
    AndroidInjectorDescriptor.Builder method(ExecutableElement method) {
      if (method == null) {
        throw new NullPointerException("Null method");
      }
      this.method = method;
      return this;
    }
    @Override
    AndroidInjectorDescriptor build() {
      if (scopesBuilder$ != null) {
        this.scopes = scopesBuilder$.build();
      } else if (this.scopes == null) {
        this.scopes = ImmutableSet.of();
      }
      if (modulesBuilder$ != null) {
        this.modules = modulesBuilder$.build();
      } else if (this.modules == null) {
        this.modules = ImmutableSet.of();
      }
      if (this.injectedType == null
          || this.enclosingModule == null
          || this.method == null) {
        StringBuilder missing = new StringBuilder();
        if (this.injectedType == null) {
          missing.append(" injectedType");
        }
        if (this.enclosingModule == null) {
          missing.append(" enclosingModule");
        }
        if (this.method == null) {
          missing.append(" method");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_AndroidInjectorDescriptor(
          this.injectedType,
          this.scopes,
          this.modules,
          this.enclosingModule,
          this.method);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy