com.google.template.soy.jssrc.dsl.AutoValue_Switch Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of soy Show documentation
Show all versions of soy Show documentation
Closure Templates are a client-side and server-side templating system.
package com.google.template.soy.jssrc.dsl;
import com.google.common.collect.ImmutableList;
import javax.annotation.Generated;
import javax.annotation.Nullable;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_Switch extends Switch {
private final CodeChunk.WithValue switchOn;
private final ImmutableList caseClauses;
private final CodeChunk defaultCaseBody;
AutoValue_Switch(
CodeChunk.WithValue switchOn,
ImmutableList caseClauses,
@Nullable CodeChunk defaultCaseBody) {
if (switchOn == null) {
throw new NullPointerException("Null switchOn");
}
this.switchOn = switchOn;
if (caseClauses == null) {
throw new NullPointerException("Null caseClauses");
}
this.caseClauses = caseClauses;
this.defaultCaseBody = defaultCaseBody;
}
@Override
CodeChunk.WithValue switchOn() {
return switchOn;
}
@Override
ImmutableList caseClauses() {
return caseClauses;
}
@Nullable
@Override
CodeChunk defaultCaseBody() {
return defaultCaseBody;
}
@Override
public String toString() {
return "Switch{"
+ "switchOn=" + switchOn + ", "
+ "caseClauses=" + caseClauses + ", "
+ "defaultCaseBody=" + defaultCaseBody
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Switch) {
Switch that = (Switch) o;
return (this.switchOn.equals(that.switchOn()))
&& (this.caseClauses.equals(that.caseClauses()))
&& ((this.defaultCaseBody == null) ? (that.defaultCaseBody() == null) : this.defaultCaseBody.equals(that.defaultCaseBody()));
}
return false;
}
@Override
public int hashCode() {
int h = 1;
h *= 1000003;
h ^= this.switchOn.hashCode();
h *= 1000003;
h ^= this.caseClauses.hashCode();
h *= 1000003;
h ^= (defaultCaseBody == null) ? 0 : this.defaultCaseBody.hashCode();
return h;
}
}