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

com.google.javascript.jscomp.parsing.AutoValue_Config Maven / Gradle / Ivy

Go to download

Closure Compiler is a JavaScript optimizing compiler. It parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes what's left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls. It is used in many of Google's JavaScript apps, including Gmail, Google Web Search, Google Maps, and Google Docs.

There is a newer version: v20240317
Show newest version


package com.google.javascript.jscomp.parsing;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import javax.annotation.processing.Generated;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
 final class AutoValue_Config extends Config {

  private final Config.LanguageMode languageMode;
  private final Config.StrictMode strictMode;
  private final Config.JsDocParsing jsDocParsingMode;
  private final Config.RunMode runMode;
  private final ImmutableMap annotations;
  private final ImmutableSet suppressionNames;
  private final ImmutableSet closurePrimitiveNames;
  private final boolean parseInlineSourceMaps;

  private AutoValue_Config(
      Config.LanguageMode languageMode,
      Config.StrictMode strictMode,
      Config.JsDocParsing jsDocParsingMode,
      Config.RunMode runMode,
      ImmutableMap annotations,
      ImmutableSet suppressionNames,
      ImmutableSet closurePrimitiveNames,
      boolean parseInlineSourceMaps) {
    this.languageMode = languageMode;
    this.strictMode = strictMode;
    this.jsDocParsingMode = jsDocParsingMode;
    this.runMode = runMode;
    this.annotations = annotations;
    this.suppressionNames = suppressionNames;
    this.closurePrimitiveNames = closurePrimitiveNames;
    this.parseInlineSourceMaps = parseInlineSourceMaps;
  }

  @Override
  public Config.LanguageMode languageMode() {
    return languageMode;
  }

  @Override
  public Config.StrictMode strictMode() {
    return strictMode;
  }

  @Override
  public Config.JsDocParsing jsDocParsingMode() {
    return jsDocParsingMode;
  }

  @Override
  public Config.RunMode runMode() {
    return runMode;
  }

  @Override
  public ImmutableMap annotations() {
    return annotations;
  }

  @Override
  public ImmutableSet suppressionNames() {
    return suppressionNames;
  }

  @Override
  ImmutableSet closurePrimitiveNames() {
    return closurePrimitiveNames;
  }

  @Override
  public boolean parseInlineSourceMaps() {
    return parseInlineSourceMaps;
  }

  @Override
  public String toString() {
    return "Config{"
         + "languageMode=" + languageMode + ", "
         + "strictMode=" + strictMode + ", "
         + "jsDocParsingMode=" + jsDocParsingMode + ", "
         + "runMode=" + runMode + ", "
         + "annotations=" + annotations + ", "
         + "suppressionNames=" + suppressionNames + ", "
         + "closurePrimitiveNames=" + closurePrimitiveNames + ", "
         + "parseInlineSourceMaps=" + parseInlineSourceMaps
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof Config) {
      Config that = (Config) o;
      return (this.languageMode.equals(that.languageMode()))
           && (this.strictMode.equals(that.strictMode()))
           && (this.jsDocParsingMode.equals(that.jsDocParsingMode()))
           && (this.runMode.equals(that.runMode()))
           && (this.annotations.equals(that.annotations()))
           && (this.suppressionNames.equals(that.suppressionNames()))
           && (this.closurePrimitiveNames.equals(that.closurePrimitiveNames()))
           && (this.parseInlineSourceMaps == that.parseInlineSourceMaps());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= languageMode.hashCode();
    h$ *= 1000003;
    h$ ^= strictMode.hashCode();
    h$ *= 1000003;
    h$ ^= jsDocParsingMode.hashCode();
    h$ *= 1000003;
    h$ ^= runMode.hashCode();
    h$ *= 1000003;
    h$ ^= annotations.hashCode();
    h$ *= 1000003;
    h$ ^= suppressionNames.hashCode();
    h$ *= 1000003;
    h$ ^= closurePrimitiveNames.hashCode();
    h$ *= 1000003;
    h$ ^= parseInlineSourceMaps ? 1231 : 1237;
    return h$;
  }

  static final class Builder extends Config.Builder {
    private Config.LanguageMode languageMode;
    private Config.StrictMode strictMode;
    private Config.JsDocParsing jsDocParsingMode;
    private Config.RunMode runMode;
    private ImmutableMap annotations;
    private ImmutableSet suppressionNames;
    private ImmutableSet closurePrimitiveNames;
    private Boolean parseInlineSourceMaps;
    Builder() {
    }
    @Override
    public Config.Builder setLanguageMode(Config.LanguageMode languageMode) {
      if (languageMode == null) {
        throw new NullPointerException("Null languageMode");
      }
      this.languageMode = languageMode;
      return this;
    }
    @Override
    public Config.Builder setStrictMode(Config.StrictMode strictMode) {
      if (strictMode == null) {
        throw new NullPointerException("Null strictMode");
      }
      this.strictMode = strictMode;
      return this;
    }
    @Override
    public Config.Builder setJsDocParsingMode(Config.JsDocParsing jsDocParsingMode) {
      if (jsDocParsingMode == null) {
        throw new NullPointerException("Null jsDocParsingMode");
      }
      this.jsDocParsingMode = jsDocParsingMode;
      return this;
    }
    @Override
    public Config.Builder setRunMode(Config.RunMode runMode) {
      if (runMode == null) {
        throw new NullPointerException("Null runMode");
      }
      this.runMode = runMode;
      return this;
    }
    @Override
    public Config.Builder setAnnotations(ImmutableMap annotations) {
      if (annotations == null) {
        throw new NullPointerException("Null annotations");
      }
      this.annotations = annotations;
      return this;
    }
    @Override
    public Config.Builder setSuppressionNames(Iterable suppressionNames) {
      if (suppressionNames == null) {
        throw new NullPointerException("Null suppressionNames");
      }
      this.suppressionNames = ImmutableSet.copyOf(suppressionNames);
      return this;
    }
    @Override
    Config.Builder setClosurePrimitiveNames(Iterable closurePrimitiveNames) {
      if (closurePrimitiveNames == null) {
        throw new NullPointerException("Null closurePrimitiveNames");
      }
      this.closurePrimitiveNames = ImmutableSet.copyOf(closurePrimitiveNames);
      return this;
    }
    @Override
    public Config.Builder setParseInlineSourceMaps(boolean parseInlineSourceMaps) {
      this.parseInlineSourceMaps = parseInlineSourceMaps;
      return this;
    }
    @Override
    public Config build() {
      String missing = "";
      if (this.languageMode == null) {
        missing += " languageMode";
      }
      if (this.strictMode == null) {
        missing += " strictMode";
      }
      if (this.jsDocParsingMode == null) {
        missing += " jsDocParsingMode";
      }
      if (this.runMode == null) {
        missing += " runMode";
      }
      if (this.annotations == null) {
        missing += " annotations";
      }
      if (this.suppressionNames == null) {
        missing += " suppressionNames";
      }
      if (this.closurePrimitiveNames == null) {
        missing += " closurePrimitiveNames";
      }
      if (this.parseInlineSourceMaps == null) {
        missing += " parseInlineSourceMaps";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_Config(
          this.languageMode,
          this.strictMode,
          this.jsDocParsingMode,
          this.runMode,
          this.annotations,
          this.suppressionNames,
          this.closurePrimitiveNames,
          this.parseInlineSourceMaps);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy