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

com.google.javascript.jscomp.modules.AutoValue_Module 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.modules;

import com.google.common.collect.ImmutableMap;
import com.google.javascript.jscomp.deps.ModuleLoader;
import javax.annotation.processing.Generated;
import org.jspecify.nullness.Nullable;

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

  private final ModuleMetadataMap.ModuleMetadata metadata;
  private final ModuleLoader.@Nullable ModulePath path;
  private final ImmutableMap namespace;
  private final ImmutableMap boundNames;
  private final ImmutableMap localNameToLocalExport;
  private final @Nullable String closureNamespace;

  private AutoValue_Module(
      ModuleMetadataMap.ModuleMetadata metadata,
       ModuleLoader.@Nullable ModulePath path,
      ImmutableMap namespace,
      ImmutableMap boundNames,
      ImmutableMap localNameToLocalExport,
       @Nullable String closureNamespace) {
    this.metadata = metadata;
    this.path = path;
    this.namespace = namespace;
    this.boundNames = boundNames;
    this.localNameToLocalExport = localNameToLocalExport;
    this.closureNamespace = closureNamespace;
  }

  @Override
  public ModuleMetadataMap.ModuleMetadata metadata() {
    return metadata;
  }

  @Override
  public ModuleLoader.@Nullable ModulePath path() {
    return path;
  }

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

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

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

  @Override
  public @Nullable String closureNamespace() {
    return closureNamespace;
  }

  @Override
  public String toString() {
    return "Module{"
         + "metadata=" + metadata + ", "
         + "path=" + path + ", "
         + "namespace=" + namespace + ", "
         + "boundNames=" + boundNames + ", "
         + "localNameToLocalExport=" + localNameToLocalExport + ", "
         + "closureNamespace=" + closureNamespace
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof Module) {
      Module that = (Module) o;
      return (this.metadata.equals(that.metadata()))
           && ((this.path == null) ? (that.path() == null) : this.path.equals(that.path()))
           && (this.namespace.equals(that.namespace()))
           && (this.boundNames.equals(that.boundNames()))
           && (this.localNameToLocalExport.equals(that.localNameToLocalExport()))
           && ((this.closureNamespace == null) ? (that.closureNamespace() == null) : this.closureNamespace.equals(that.closureNamespace()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= metadata.hashCode();
    h$ *= 1000003;
    h$ ^= (path == null) ? 0 : path.hashCode();
    h$ *= 1000003;
    h$ ^= namespace.hashCode();
    h$ *= 1000003;
    h$ ^= boundNames.hashCode();
    h$ *= 1000003;
    h$ ^= localNameToLocalExport.hashCode();
    h$ *= 1000003;
    h$ ^= (closureNamespace == null) ? 0 : closureNamespace.hashCode();
    return h$;
  }

  @Override
  public Module.Builder toBuilder() {
    return new Builder(this);
  }

  static final class Builder extends Module.Builder {
    private ModuleMetadataMap.ModuleMetadata metadata;
    private ModuleLoader.@Nullable ModulePath path;
    private ImmutableMap namespace;
    private ImmutableMap boundNames;
    private ImmutableMap localNameToLocalExport;
    private @Nullable String closureNamespace;
    Builder() {
    }
    private Builder(Module source) {
      this.metadata = source.metadata();
      this.path = source.path();
      this.namespace = source.namespace();
      this.boundNames = source.boundNames();
      this.localNameToLocalExport = source.localNameToLocalExport();
      this.closureNamespace = source.closureNamespace();
    }
    @Override
    public Module.Builder metadata(ModuleMetadataMap.ModuleMetadata metadata) {
      if (metadata == null) {
        throw new NullPointerException("Null metadata");
      }
      this.metadata = metadata;
      return this;
    }
    @Override
    public Module.Builder path(ModuleLoader.@Nullable ModulePath path) {
      this.path = path;
      return this;
    }
    @Override
    public Module.Builder namespace(ImmutableMap namespace) {
      if (namespace == null) {
        throw new NullPointerException("Null namespace");
      }
      this.namespace = namespace;
      return this;
    }
    @Override
    public Module.Builder boundNames(ImmutableMap boundNames) {
      if (boundNames == null) {
        throw new NullPointerException("Null boundNames");
      }
      this.boundNames = boundNames;
      return this;
    }
    @Override
    public Module.Builder localNameToLocalExport(ImmutableMap localNameToLocalExport) {
      if (localNameToLocalExport == null) {
        throw new NullPointerException("Null localNameToLocalExport");
      }
      this.localNameToLocalExport = localNameToLocalExport;
      return this;
    }
    @Override
    public Module.Builder closureNamespace(@Nullable String closureNamespace) {
      this.closureNamespace = closureNamespace;
      return this;
    }
    @Override
    public Module build() {
      String missing = "";
      if (this.metadata == null) {
        missing += " metadata";
      }
      if (this.namespace == null) {
        missing += " namespace";
      }
      if (this.boundNames == null) {
        missing += " boundNames";
      }
      if (this.localNameToLocalExport == null) {
        missing += " localNameToLocalExport";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_Module(
          this.metadata,
          this.path,
          this.namespace,
          this.boundNames,
          this.localNameToLocalExport,
          this.closureNamespace);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy