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

com.google.template.soy.jssrc.dsl.AutoValue_Switch Maven / Gradle / Ivy

There is a newer version: 2024-02-26
Show newest version

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;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy