dagger.internal.codegen.binding.$AutoValue_ProvisionBinding Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dagger-compiler Show documentation
Show all versions of dagger-compiler Show documentation
A fast dependency injector for Android and Java.
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.base.ContributionType;
import dagger.internal.codegen.model.BindingKind;
import dagger.internal.codegen.model.DaggerAnnotation;
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_ProvisionBinding extends ProvisionBinding {
private final ContributionType contributionType;
private final Key key;
private final Optional bindingElement;
private final Optional contributingModule;
private final BindingKind kind;
private final Nullability nullability;
private final Optional mapKey;
private final ImmutableSet provisionDependencies;
private final ImmutableSortedSet injectionSites;
private final Optional unresolved;
private final Optional scope;
$AutoValue_ProvisionBinding(
ContributionType contributionType,
Key key,
Optional bindingElement,
Optional contributingModule,
BindingKind kind,
Nullability nullability,
Optional mapKey,
ImmutableSet provisionDependencies,
ImmutableSortedSet injectionSites,
Optional unresolved,
Optional scope) {
if (contributionType == null) {
throw new NullPointerException("Null contributionType");
}
this.contributionType = contributionType;
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 (kind == null) {
throw new NullPointerException("Null kind");
}
this.kind = kind;
if (nullability == null) {
throw new NullPointerException("Null nullability");
}
this.nullability = nullability;
if (mapKey == null) {
throw new NullPointerException("Null mapKey");
}
this.mapKey = mapKey;
if (provisionDependencies == null) {
throw new NullPointerException("Null provisionDependencies");
}
this.provisionDependencies = provisionDependencies;
if (injectionSites == null) {
throw new NullPointerException("Null injectionSites");
}
this.injectionSites = injectionSites;
if (unresolved == null) {
throw new NullPointerException("Null unresolved");
}
this.unresolved = unresolved;
if (scope == null) {
throw new NullPointerException("Null scope");
}
this.scope = scope;
}
@Override
public ContributionType contributionType() {
return contributionType;
}
@Override
public Key key() {
return key;
}
@Override
public Optional bindingElement() {
return bindingElement;
}
@Override
public Optional contributingModule() {
return contributingModule;
}
@Override
public BindingKind kind() {
return kind;
}
@Override
public Nullability nullability() {
return nullability;
}
@Override
public Optional mapKey() {
return mapKey;
}
@Override
public ImmutableSet provisionDependencies() {
return provisionDependencies;
}
@Override
public ImmutableSortedSet injectionSites() {
return injectionSites;
}
@Override
public Optional unresolved() {
return unresolved;
}
@Override
public Optional scope() {
return scope;
}
@Override
public String toString() {
return "ProvisionBinding{"
+ "contributionType=" + contributionType + ", "
+ "key=" + key + ", "
+ "bindingElement=" + bindingElement + ", "
+ "contributingModule=" + contributingModule + ", "
+ "kind=" + kind + ", "
+ "nullability=" + nullability + ", "
+ "mapKey=" + mapKey + ", "
+ "provisionDependencies=" + provisionDependencies + ", "
+ "injectionSites=" + injectionSites + ", "
+ "unresolved=" + unresolved + ", "
+ "scope=" + scope
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof ProvisionBinding) {
ProvisionBinding that = (ProvisionBinding) o;
return this.contributionType.equals(that.contributionType())
&& this.key.equals(that.key())
&& this.bindingElement.equals(that.bindingElement())
&& this.contributingModule.equals(that.contributingModule())
&& this.kind.equals(that.kind())
&& this.nullability.equals(that.nullability())
&& this.mapKey.equals(that.mapKey())
&& this.provisionDependencies.equals(that.provisionDependencies())
&& this.injectionSites.equals(that.injectionSites())
&& this.unresolved.equals(that.unresolved())
&& this.scope.equals(that.scope());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= contributionType.hashCode();
h$ *= 1000003;
h$ ^= key.hashCode();
h$ *= 1000003;
h$ ^= bindingElement.hashCode();
h$ *= 1000003;
h$ ^= contributingModule.hashCode();
h$ *= 1000003;
h$ ^= kind.hashCode();
h$ *= 1000003;
h$ ^= nullability.hashCode();
h$ *= 1000003;
h$ ^= mapKey.hashCode();
h$ *= 1000003;
h$ ^= provisionDependencies.hashCode();
h$ *= 1000003;
h$ ^= injectionSites.hashCode();
h$ *= 1000003;
h$ ^= unresolved.hashCode();
h$ *= 1000003;
h$ ^= scope.hashCode();
return h$;
}
@Override
public ProvisionBinding.Builder toBuilder() {
return new Builder(this);
}
static class Builder extends ProvisionBinding.Builder {
private ContributionType contributionType;
private Key key;
private Optional bindingElement = Optional.empty();
private Optional contributingModule = Optional.empty();
private BindingKind kind;
private Nullability nullability;
private Optional mapKey = Optional.empty();
private ImmutableSet provisionDependencies;
private ImmutableSortedSet injectionSites;
private Optional unresolved = Optional.empty();
private Optional scope = Optional.empty();
Builder() {
}
private Builder(ProvisionBinding source) {
this.contributionType = source.contributionType();
this.key = source.key();
this.bindingElement = source.bindingElement();
this.contributingModule = source.contributingModule();
this.kind = source.kind();
this.nullability = source.nullability();
this.mapKey = source.mapKey();
this.provisionDependencies = source.provisionDependencies();
this.injectionSites = source.injectionSites();
this.unresolved = source.unresolved();
this.scope = source.scope();
}
@Override
public ProvisionBinding.Builder contributionType(ContributionType contributionType) {
if (contributionType == null) {
throw new NullPointerException("Null contributionType");
}
this.contributionType = contributionType;
return this;
}
@Override
public ProvisionBinding.Builder key(Key key) {
if (key == null) {
throw new NullPointerException("Null key");
}
this.key = key;
return this;
}
@Override
public ProvisionBinding.Builder bindingElement(XElement bindingElement) {
this.bindingElement = Optional.of(bindingElement);
return this;
}
@Override
ProvisionBinding.Builder bindingElement(Optional bindingElement) {
if (bindingElement == null) {
throw new NullPointerException("Null bindingElement");
}
this.bindingElement = bindingElement;
return this;
}
@Override
ProvisionBinding.Builder contributingModule(XTypeElement contributingModule) {
this.contributingModule = Optional.of(contributingModule);
return this;
}
@Override
public ProvisionBinding.Builder kind(BindingKind kind) {
if (kind == null) {
throw new NullPointerException("Null kind");
}
this.kind = kind;
return this;
}
@Override
public ProvisionBinding.Builder nullability(Nullability nullability) {
if (nullability == null) {
throw new NullPointerException("Null nullability");
}
this.nullability = nullability;
return this;
}
@Override
ProvisionBinding.Builder mapKey(Optional mapKey) {
if (mapKey == null) {
throw new NullPointerException("Null mapKey");
}
this.mapKey = mapKey;
return this;
}
@Override
ProvisionBinding.Builder provisionDependencies(Iterable provisionDependencies) {
this.provisionDependencies = ImmutableSet.copyOf(provisionDependencies);
return this;
}
@Override
public ProvisionBinding.Builder injectionSites(ImmutableSortedSet injectionSites) {
if (injectionSites == null) {
throw new NullPointerException("Null injectionSites");
}
this.injectionSites = injectionSites;
return this;
}
@Override
public ProvisionBinding.Builder unresolved(ProvisionBinding unresolved) {
this.unresolved = Optional.of(unresolved);
return this;
}
@Override
public ProvisionBinding.Builder scope(Optional scope) {
if (scope == null) {
throw new NullPointerException("Null scope");
}
this.scope = scope;
return this;
}
@Override
ProvisionBinding build() {
if (this.contributionType == null
|| this.key == null
|| this.kind == null
|| this.nullability == null
|| this.provisionDependencies == null
|| this.injectionSites == null) {
StringBuilder missing = new StringBuilder();
if (this.contributionType == null) {
missing.append(" contributionType");
}
if (this.key == null) {
missing.append(" key");
}
if (this.kind == null) {
missing.append(" kind");
}
if (this.nullability == null) {
missing.append(" nullability");
}
if (this.provisionDependencies == null) {
missing.append(" provisionDependencies");
}
if (this.injectionSites == null) {
missing.append(" injectionSites");
}
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_ProvisionBinding(
this.contributionType,
this.key,
this.bindingElement,
this.contributingModule,
this.kind,
this.nullability,
this.mapKey,
this.provisionDependencies,
this.injectionSites,
this.unresolved,
this.scope);
}
}
}