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

com.google.gerrit.server.notedb.AutoValue_CommitRewriter_CommitDiff Maven / Gradle / Ivy

The newest version!
package com.google.gerrit.server.notedb;

import javax.annotation.processing.Generated;
import org.eclipse.jgit.lib.ObjectId;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_CommitRewriter_CommitDiff extends CommitRewriter.CommitDiff {

  private final ObjectId oldSha1;

  private final String diff;

  AutoValue_CommitRewriter_CommitDiff(
      ObjectId oldSha1,
      String diff) {
    if (oldSha1 == null) {
      throw new NullPointerException("Null oldSha1");
    }
    this.oldSha1 = oldSha1;
    if (diff == null) {
      throw new NullPointerException("Null diff");
    }
    this.diff = diff;
  }

  @Override
  public ObjectId oldSha1() {
    return oldSha1;
  }

  @Override
  public String diff() {
    return diff;
  }

  @Override
  public String toString() {
    return "CommitDiff{"
        + "oldSha1=" + oldSha1 + ", "
        + "diff=" + diff
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof CommitRewriter.CommitDiff) {
      CommitRewriter.CommitDiff that = (CommitRewriter.CommitDiff) o;
      return this.oldSha1.equals(that.oldSha1())
          && this.diff.equals(that.diff());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= oldSha1.hashCode();
    h$ *= 1000003;
    h$ ^= diff.hashCode();
    return h$;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy