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.
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 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 Key key;
private final Optional bindingElement;
private final Optional contributingModule;
private final ImmutableSet dependencies;
private final Optional extends Binding> unresolved;
private final Optional scope;
private final Nullability nullability;
$AutoValue_ProvisionBinding(
Key key,
Optional bindingElement,
Optional contributingModule,
ImmutableSet dependencies,
Optional extends Binding> unresolved,
Optional scope,
Nullability nullability) {
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 (dependencies == null) {
throw new NullPointerException("Null dependencies");
}
this.dependencies = dependencies;
if (unresolved == null) {
throw new NullPointerException("Null unresolved");
}
this.unresolved = unresolved;
if (scope == null) {
throw new NullPointerException("Null scope");
}
this.scope = scope;
if (nullability == null) {
throw new NullPointerException("Null nullability");
}
this.nullability = nullability;
}
@Override
public Key key() {
return key;
}
@Override
public Optional bindingElement() {
return bindingElement;
}
@Override
public Optional contributingModule() {
return contributingModule;
}
@Override
public ImmutableSet dependencies() {
return dependencies;
}
@Override
public Optional extends Binding> unresolved() {
return unresolved;
}
@Override
public Optional scope() {
return scope;
}
@Override
public Nullability nullability() {
return nullability;
}
@Override
public String toString() {
return "ProvisionBinding{"
+ "key=" + key + ", "
+ "bindingElement=" + bindingElement + ", "
+ "contributingModule=" + contributingModule + ", "
+ "dependencies=" + dependencies + ", "
+ "unresolved=" + unresolved + ", "
+ "scope=" + scope + ", "
+ "nullability=" + nullability
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof ProvisionBinding) {
ProvisionBinding that = (ProvisionBinding) o;
return this.key.equals(that.key())
&& this.bindingElement.equals(that.bindingElement())
&& this.contributingModule.equals(that.contributingModule())
&& this.dependencies.equals(that.dependencies())
&& this.unresolved.equals(that.unresolved())
&& this.scope.equals(that.scope())
&& this.nullability.equals(that.nullability());
}
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$ ^= dependencies.hashCode();
h$ *= 1000003;
h$ ^= unresolved.hashCode();
h$ *= 1000003;
h$ ^= scope.hashCode();
h$ *= 1000003;
h$ ^= nullability.hashCode();
return h$;
}
@Override
public ProvisionBinding.Builder toBuilder() {
return new Builder(this);
}
static class Builder extends ProvisionBinding.Builder {
private Key key;
private Optional bindingElement = Optional.empty();
private Optional contributingModule = Optional.empty();
private ImmutableSet dependencies;
private Optional extends Binding> unresolved = Optional.empty();
private Optional scope = Optional.empty();
private Nullability nullability;
Builder() {
}
private Builder(ProvisionBinding source) {
this.key = source.key();
this.bindingElement = source.bindingElement();
this.contributingModule = source.contributingModule();
this.dependencies = source.dependencies();
this.unresolved = source.unresolved();
this.scope = source.scope();
this.nullability = source.nullability();
}
@Override
ProvisionBinding.Builder key(Key key) {
if (key == null) {
throw new NullPointerException("Null key");
}
this.key = key;
return this;
}
@Override
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
ProvisionBinding.Builder dependencies(Iterable dependencies) {
this.dependencies = ImmutableSet.copyOf(dependencies);
return this;
}
@Override
ProvisionBinding.Builder unresolved(Optional extends Binding> unresolved) {
if (unresolved == null) {
throw new NullPointerException("Null unresolved");
}
this.unresolved = unresolved;
return this;
}
@Override
ProvisionBinding.Builder scope(Optional scope) {
if (scope == null) {
throw new NullPointerException("Null scope");
}
this.scope = scope;
return this;
}
@Override
ProvisionBinding.Builder nullability(Nullability nullability) {
if (nullability == null) {
throw new NullPointerException("Null nullability");
}
this.nullability = nullability;
return this;
}
@Override
ProvisionBinding build() {
if (this.key == null
|| this.dependencies == null
|| this.nullability == null) {
StringBuilder missing = new StringBuilder();
if (this.key == null) {
missing.append(" key");
}
if (this.dependencies == null) {
missing.append(" dependencies");
}
if (this.nullability == null) {
missing.append(" nullability");
}
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_ProvisionBinding(
this.key,
this.bindingElement,
this.contributingModule,
this.dependencies,
this.unresolved,
this.scope,
this.nullability);
}
}
}