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

com.google.gerrit.server.patch.gitdiff.AutoValue_GitModifiedFilesCacheKey Maven / Gradle / Ivy

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

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_GitModifiedFilesCacheKey extends GitModifiedFilesCacheKey {

  private final Project.NameKey project;

  private final ObjectId aTree;

  private final ObjectId bTree;

  private final int renameScore;

  private AutoValue_GitModifiedFilesCacheKey(
      Project.NameKey project,
      ObjectId aTree,
      ObjectId bTree,
      int renameScore) {
    this.project = project;
    this.aTree = aTree;
    this.bTree = bTree;
    this.renameScore = renameScore;
  }

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

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

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

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

  @Override
  public String toString() {
    return "GitModifiedFilesCacheKey{"
        + "project=" + project + ", "
        + "aTree=" + aTree + ", "
        + "bTree=" + bTree + ", "
        + "renameScore=" + renameScore
        + "}";
  }

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

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

  static final class Builder extends GitModifiedFilesCacheKey.Builder {
    private Project.NameKey project;
    private ObjectId aTree;
    private ObjectId bTree;
    private int renameScore;
    private byte set$0;
    Builder() {
    }
    @Override
    public GitModifiedFilesCacheKey.Builder project(Project.NameKey project) {
      if (project == null) {
        throw new NullPointerException("Null project");
      }
      this.project = project;
      return this;
    }
    @Override
    public GitModifiedFilesCacheKey.Builder aTree(ObjectId aTree) {
      if (aTree == null) {
        throw new NullPointerException("Null aTree");
      }
      this.aTree = aTree;
      return this;
    }
    @Override
    public GitModifiedFilesCacheKey.Builder bTree(ObjectId bTree) {
      if (bTree == null) {
        throw new NullPointerException("Null bTree");
      }
      this.bTree = bTree;
      return this;
    }
    @Override
    public GitModifiedFilesCacheKey.Builder renameScore(int renameScore) {
      this.renameScore = renameScore;
      set$0 |= (byte) 1;
      return this;
    }
    @Override
    public GitModifiedFilesCacheKey build() {
      if (set$0 != 1
          || this.project == null
          || this.aTree == null
          || this.bTree == null) {
        StringBuilder missing = new StringBuilder();
        if (this.project == null) {
          missing.append(" project");
        }
        if (this.aTree == null) {
          missing.append(" aTree");
        }
        if (this.bTree == null) {
          missing.append(" bTree");
        }
        if ((set$0 & 1) == 0) {
          missing.append(" renameScore");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_GitModifiedFilesCacheKey(
          this.project,
          this.aTree,
          this.bTree,
          this.renameScore);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy