com.google.errorprone.bugpatterns.AutoValue_StronglyType Maven / Gradle / Ivy
package com.google.errorprone.bugpatterns;
import com.google.common.collect.ImmutableSet;
import com.google.errorprone.matchers.Matcher;
import com.sun.source.tree.ExpressionTree;
import com.sun.tools.javac.code.Type;
import java.util.function.Function;
import javax.annotation.processing.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_StronglyType extends StronglyType {
private final Function renameFunction;
private final ImmutableSet primitiveTypesToReplace;
private final Matcher factoryMatcher;
private final BugChecker bugChecker;
private AutoValue_StronglyType(
Function renameFunction,
ImmutableSet primitiveTypesToReplace,
Matcher factoryMatcher,
BugChecker bugChecker) {
this.renameFunction = renameFunction;
this.primitiveTypesToReplace = primitiveTypesToReplace;
this.factoryMatcher = factoryMatcher;
this.bugChecker = bugChecker;
}
@Override
Function renameFunction() {
return renameFunction;
}
@Override
ImmutableSet primitiveTypesToReplace() {
return primitiveTypesToReplace;
}
@Override
Matcher factoryMatcher() {
return factoryMatcher;
}
@Override
BugChecker bugChecker() {
return bugChecker;
}
@Override
public String toString() {
return "StronglyType{"
+ "renameFunction=" + renameFunction + ", "
+ "primitiveTypesToReplace=" + primitiveTypesToReplace + ", "
+ "factoryMatcher=" + factoryMatcher + ", "
+ "bugChecker=" + bugChecker
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof StronglyType) {
StronglyType that = (StronglyType) o;
return this.renameFunction.equals(that.renameFunction())
&& this.primitiveTypesToReplace.equals(that.primitiveTypesToReplace())
&& this.factoryMatcher.equals(that.factoryMatcher())
&& this.bugChecker.equals(that.bugChecker());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= renameFunction.hashCode();
h$ *= 1000003;
h$ ^= primitiveTypesToReplace.hashCode();
h$ *= 1000003;
h$ ^= factoryMatcher.hashCode();
h$ *= 1000003;
h$ ^= bugChecker.hashCode();
return h$;
}
static final class Builder extends StronglyType.Builder {
private Function renameFunction;
private ImmutableSet.Builder primitiveTypesToReplaceBuilder$;
private ImmutableSet primitiveTypesToReplace;
private Matcher factoryMatcher;
private BugChecker bugChecker;
Builder() {
}
@Override
public StronglyType.Builder setRenameFunction(Function renameFunction) {
if (renameFunction == null) {
throw new NullPointerException("Null renameFunction");
}
this.renameFunction = renameFunction;
return this;
}
@Override
ImmutableSet.Builder primitiveTypesToReplaceBuilder() {
if (primitiveTypesToReplaceBuilder$ == null) {
primitiveTypesToReplaceBuilder$ = ImmutableSet.builder();
}
return primitiveTypesToReplaceBuilder$;
}
@Override
public StronglyType.Builder setFactoryMatcher(Matcher factoryMatcher) {
if (factoryMatcher == null) {
throw new NullPointerException("Null factoryMatcher");
}
this.factoryMatcher = factoryMatcher;
return this;
}
@Override
StronglyType.Builder setBugChecker(BugChecker bugChecker) {
if (bugChecker == null) {
throw new NullPointerException("Null bugChecker");
}
this.bugChecker = bugChecker;
return this;
}
@Override
public StronglyType build() {
if (primitiveTypesToReplaceBuilder$ != null) {
this.primitiveTypesToReplace = primitiveTypesToReplaceBuilder$.build();
} else if (this.primitiveTypesToReplace == null) {
this.primitiveTypesToReplace = ImmutableSet.of();
}
if (this.renameFunction == null
|| this.factoryMatcher == null
|| this.bugChecker == null) {
StringBuilder missing = new StringBuilder();
if (this.renameFunction == null) {
missing.append(" renameFunction");
}
if (this.factoryMatcher == null) {
missing.append(" factoryMatcher");
}
if (this.bugChecker == null) {
missing.append(" bugChecker");
}
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_StronglyType(
this.renameFunction,
this.primitiveTypesToReplace,
this.factoryMatcher,
this.bugChecker);
}
}
}