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

com.google.javascript.refactoring.AutoValue_CodeReplacement 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. This binary checks for style issues such as incorrect or missing JSDoc usage, and missing goog.require() statements. It does not do more advanced checks such as typechecking.

There is a newer version: v20200830
Show newest version

package com.google.javascript.refactoring;

import javax.annotation.Generated;

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

  private final int startPosition;
  private final int length;
  private final String newContent;
  private final String sortKey;

  AutoValue_CodeReplacement(
      int startPosition,
      int length,
      String newContent,
      String sortKey) {
    this.startPosition = startPosition;
    this.length = length;
    if (newContent == null) {
      throw new NullPointerException("Null newContent");
    }
    this.newContent = newContent;
    if (sortKey == null) {
      throw new NullPointerException("Null sortKey");
    }
    this.sortKey = sortKey;
  }

  @Override
  public int getStartPosition() {
    return startPosition;
  }

  @Override
  public int getLength() {
    return length;
  }

  @Override
  public String getNewContent() {
    return newContent;
  }

  @Override
  public String getSortKey() {
    return sortKey;
  }

  @Override
  public String toString() {
    return "CodeReplacement{"
        + "startPosition=" + startPosition + ", "
        + "length=" + length + ", "
        + "newContent=" + newContent + ", "
        + "sortKey=" + sortKey
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof CodeReplacement) {
      CodeReplacement that = (CodeReplacement) o;
      return (this.startPosition == that.getStartPosition())
           && (this.length == that.getLength())
           && (this.newContent.equals(that.getNewContent()))
           && (this.sortKey.equals(that.getSortKey()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h = 1;
    h *= 1000003;
    h ^= this.startPosition;
    h *= 1000003;
    h ^= this.length;
    h *= 1000003;
    h ^= this.newContent.hashCode();
    h *= 1000003;
    h ^= this.sortKey.hashCode();
    return h;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy