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

com.google.gerrit.server.patch.diff.AutoValue_ModifiedFilesCacheKey Maven / Gradle / Ivy

There is a newer version: 3.11.0-rc3
Show newest version
package com.google.gerrit.server.patch.diff;

import com.google.gerrit.entities.Project;
import javax.annotation.processing.Generated;
import org.eclipse.jgit.lib.ObjectId;

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

  private final Project.NameKey project;

  private final ObjectId aCommit;

  private final ObjectId bCommit;

  private final int renameScore;

  private AutoValue_ModifiedFilesCacheKey(
      Project.NameKey project,
      ObjectId aCommit,
      ObjectId bCommit,
      int renameScore) {
    this.project = project;
    this.aCommit = aCommit;
    this.bCommit = bCommit;
    this.renameScore = renameScore;
  }

  @Override
  public Project.NameKey project() {
    return project;
  }

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

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

  @Override
  public int renameScore() {
    return renameScore;
  }

  @Override
  public String toString() {
    return "ModifiedFilesCacheKey{"
        + "project=" + project + ", "
        + "aCommit=" + aCommit + ", "
        + "bCommit=" + bCommit + ", "
        + "renameScore=" + renameScore
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof ModifiedFilesCacheKey) {
      ModifiedFilesCacheKey that = (ModifiedFilesCacheKey) o;
      return this.project.equals(that.project())
          && this.aCommit.equals(that.aCommit())
          && this.bCommit.equals(that.bCommit())
          && this.renameScore == that.renameScore();
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= project.hashCode();
    h$ *= 1000003;
    h$ ^= aCommit.hashCode();
    h$ *= 1000003;
    h$ ^= bCommit.hashCode();
    h$ *= 1000003;
    h$ ^= renameScore;
    return h$;
  }

  static final class Builder extends ModifiedFilesCacheKey.Builder {
    private Project.NameKey project;
    private ObjectId aCommit;
    private ObjectId bCommit;
    private Integer renameScore;
    Builder() {
    }
    @Override
    public ModifiedFilesCacheKey.Builder project(Project.NameKey project) {
      if (project == null) {
        throw new NullPointerException("Null project");
      }
      this.project = project;
      return this;
    }
    @Override
    public ModifiedFilesCacheKey.Builder aCommit(ObjectId aCommit) {
      if (aCommit == null) {
        throw new NullPointerException("Null aCommit");
      }
      this.aCommit = aCommit;
      return this;
    }
    @Override
    public ModifiedFilesCacheKey.Builder bCommit(ObjectId bCommit) {
      if (bCommit == null) {
        throw new NullPointerException("Null bCommit");
      }
      this.bCommit = bCommit;
      return this;
    }
    @Override
    public ModifiedFilesCacheKey.Builder renameScore(int renameScore) {
      this.renameScore = renameScore;
      return this;
    }
    @Override
    public ModifiedFilesCacheKey build() {
      String missing = "";
      if (this.project == null) {
        missing += " project";
      }
      if (this.aCommit == null) {
        missing += " aCommit";
      }
      if (this.bCommit == null) {
        missing += " bCommit";
      }
      if (this.renameScore == null) {
        missing += " renameScore";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_ModifiedFilesCacheKey(
          this.project,
          this.aCommit,
          this.bCommit,
          this.renameScore);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy