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

dagger.internal.codegen.binding.$AutoValue_InjectionBinding Maven / Gradle / Ivy

The newest version!
package dagger.internal.codegen.binding;

import androidx.room.compiler.processing.XElement;
import androidx.room.compiler.processing.XTypeElement;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedSet;
import dagger.internal.codegen.model.DependencyRequest;
import dagger.internal.codegen.model.Key;
import dagger.internal.codegen.model.Scope;
import java.util.Optional;

// Generated by com.google.auto.value.processor.AutoValueProcessor
abstract class $AutoValue_InjectionBinding extends InjectionBinding {

  private final Key key;

  private final Optional bindingElement;

  private final Optional contributingModule;

  private final Optional unresolved;

  private final Optional scope;

  private final ImmutableSet constructorDependencies;

  private final ImmutableSortedSet injectionSites;

  $AutoValue_InjectionBinding(
      Key key,
      Optional bindingElement,
      Optional contributingModule,
      Optional unresolved,
      Optional scope,
      ImmutableSet constructorDependencies,
      ImmutableSortedSet injectionSites) {
    if (key == null) {
      throw new NullPointerException("Null key");
    }
    this.key = key;
    if (bindingElement == null) {
      throw new NullPointerException("Null bindingElement");
    }
    this.bindingElement = bindingElement;
    if (contributingModule == null) {
      throw new NullPointerException("Null contributingModule");
    }
    this.contributingModule = contributingModule;
    if (unresolved == null) {
      throw new NullPointerException("Null unresolved");
    }
    this.unresolved = unresolved;
    if (scope == null) {
      throw new NullPointerException("Null scope");
    }
    this.scope = scope;
    if (constructorDependencies == null) {
      throw new NullPointerException("Null constructorDependencies");
    }
    this.constructorDependencies = constructorDependencies;
    if (injectionSites == null) {
      throw new NullPointerException("Null injectionSites");
    }
    this.injectionSites = injectionSites;
  }

  @Override
  public Key key() {
    return key;
  }

  @Override
  public Optional bindingElement() {
    return bindingElement;
  }

  @Override
  public Optional contributingModule() {
    return contributingModule;
  }

  @Override
  public Optional unresolved() {
    return unresolved;
  }

  @Override
  public Optional scope() {
    return scope;
  }

  @Override
  public ImmutableSet constructorDependencies() {
    return constructorDependencies;
  }

  @Override
  public ImmutableSortedSet injectionSites() {
    return injectionSites;
  }

  @Override
  public String toString() {
    return "InjectionBinding{"
        + "key=" + key + ", "
        + "bindingElement=" + bindingElement + ", "
        + "contributingModule=" + contributingModule + ", "
        + "unresolved=" + unresolved + ", "
        + "scope=" + scope + ", "
        + "constructorDependencies=" + constructorDependencies + ", "
        + "injectionSites=" + injectionSites
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof InjectionBinding) {
      InjectionBinding that = (InjectionBinding) o;
      return this.key.equals(that.key())
          && this.bindingElement.equals(that.bindingElement())
          && this.contributingModule.equals(that.contributingModule())
          && this.unresolved.equals(that.unresolved())
          && this.scope.equals(that.scope())
          && this.constructorDependencies.equals(that.constructorDependencies())
          && this.injectionSites.equals(that.injectionSites());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= key.hashCode();
    h$ *= 1000003;
    h$ ^= bindingElement.hashCode();
    h$ *= 1000003;
    h$ ^= contributingModule.hashCode();
    h$ *= 1000003;
    h$ ^= unresolved.hashCode();
    h$ *= 1000003;
    h$ ^= scope.hashCode();
    h$ *= 1000003;
    h$ ^= constructorDependencies.hashCode();
    h$ *= 1000003;
    h$ ^= injectionSites.hashCode();
    return h$;
  }

  @Override
  public InjectionBinding.Builder toBuilder() {
    return new Builder(this);
  }

  static class Builder extends InjectionBinding.Builder {
    private Key key;
    private Optional bindingElement = Optional.empty();
    private Optional contributingModule = Optional.empty();
    private Optional unresolved = Optional.empty();
    private Optional scope = Optional.empty();
    private ImmutableSet constructorDependencies;
    private ImmutableSortedSet injectionSites;
    Builder() {
    }
    private Builder(InjectionBinding source) {
      this.key = source.key();
      this.bindingElement = source.bindingElement();
      this.contributingModule = source.contributingModule();
      this.unresolved = source.unresolved();
      this.scope = source.scope();
      this.constructorDependencies = source.constructorDependencies();
      this.injectionSites = source.injectionSites();
    }
    @Override
    InjectionBinding.Builder key(Key key) {
      if (key == null) {
        throw new NullPointerException("Null key");
      }
      this.key = key;
      return this;
    }
    @Override
    InjectionBinding.Builder bindingElement(XElement bindingElement) {
      this.bindingElement = Optional.of(bindingElement);
      return this;
    }
    @Override
    InjectionBinding.Builder bindingElement(Optional bindingElement) {
      if (bindingElement == null) {
        throw new NullPointerException("Null bindingElement");
      }
      this.bindingElement = bindingElement;
      return this;
    }
    @Override
    InjectionBinding.Builder contributingModule(XTypeElement contributingModule) {
      this.contributingModule = Optional.of(contributingModule);
      return this;
    }
    @Override
    InjectionBinding.Builder unresolved(Optional unresolved) {
      if (unresolved == null) {
        throw new NullPointerException("Null unresolved");
      }
      this.unresolved = unresolved;
      return this;
    }
    @Override
    InjectionBinding.Builder scope(Optional scope) {
      if (scope == null) {
        throw new NullPointerException("Null scope");
      }
      this.scope = scope;
      return this;
    }
    @Override
    InjectionBinding.Builder constructorDependencies(Iterable constructorDependencies) {
      this.constructorDependencies = ImmutableSet.copyOf(constructorDependencies);
      return this;
    }
    @Override
    InjectionBinding.Builder injectionSites(ImmutableSortedSet injectionSites) {
      if (injectionSites == null) {
        throw new NullPointerException("Null injectionSites");
      }
      this.injectionSites = injectionSites;
      return this;
    }
    @Override
    InjectionBinding build() {
      if (this.key == null
          || this.constructorDependencies == null
          || this.injectionSites == null) {
        StringBuilder missing = new StringBuilder();
        if (this.key == null) {
          missing.append(" key");
        }
        if (this.constructorDependencies == null) {
          missing.append(" constructorDependencies");
        }
        if (this.injectionSites == null) {
          missing.append(" injectionSites");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_InjectionBinding(
          this.key,
          this.bindingElement,
          this.contributingModule,
          this.unresolved,
          this.scope,
          this.constructorDependencies,
          this.injectionSites);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy