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

com.google.gerrit.server.comment.AutoValue_CommentContextKey Maven / Gradle / Ivy

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

import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.Project;
import javax.annotation.processing.Generated;

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

  private final Project.NameKey project;

  private final Change.Id changeId;

  private final String id;

  private final String path;

  private final int patchset;

  private final int contextPadding;

  private AutoValue_CommentContextKey(
      Project.NameKey project,
      Change.Id changeId,
      String id,
      String path,
      int patchset,
      int contextPadding) {
    this.project = project;
    this.changeId = changeId;
    this.id = id;
    this.path = path;
    this.patchset = patchset;
    this.contextPadding = contextPadding;
  }

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

  @Override
  Change.Id changeId() {
    return changeId;
  }

  @Override
  String id() {
    return id;
  }

  @Override
  String path() {
    return path;
  }

  @Override
  int patchset() {
    return patchset;
  }

  @Override
  int contextPadding() {
    return contextPadding;
  }

  @Override
  public String toString() {
    return "CommentContextKey{"
        + "project=" + project + ", "
        + "changeId=" + changeId + ", "
        + "id=" + id + ", "
        + "path=" + path + ", "
        + "patchset=" + patchset + ", "
        + "contextPadding=" + contextPadding
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof CommentContextKey) {
      CommentContextKey that = (CommentContextKey) o;
      return this.project.equals(that.project())
          && this.changeId.equals(that.changeId())
          && this.id.equals(that.id())
          && this.path.equals(that.path())
          && this.patchset == that.patchset()
          && this.contextPadding == that.contextPadding();
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= project.hashCode();
    h$ *= 1000003;
    h$ ^= changeId.hashCode();
    h$ *= 1000003;
    h$ ^= id.hashCode();
    h$ *= 1000003;
    h$ ^= path.hashCode();
    h$ *= 1000003;
    h$ ^= patchset;
    h$ *= 1000003;
    h$ ^= contextPadding;
    return h$;
  }

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

  static final class Builder extends CommentContextKey.Builder {
    private Project.NameKey project;
    private Change.Id changeId;
    private String id;
    private String path;
    private int patchset;
    private int contextPadding;
    private byte set$0;
    Builder() {
    }
    private Builder(CommentContextKey source) {
      this.project = source.project();
      this.changeId = source.changeId();
      this.id = source.id();
      this.path = source.path();
      this.patchset = source.patchset();
      this.contextPadding = source.contextPadding();
      set$0 = (byte) 3;
    }
    @Override
    public CommentContextKey.Builder project(Project.NameKey project) {
      if (project == null) {
        throw new NullPointerException("Null project");
      }
      this.project = project;
      return this;
    }
    @Override
    public CommentContextKey.Builder changeId(Change.Id changeId) {
      if (changeId == null) {
        throw new NullPointerException("Null changeId");
      }
      this.changeId = changeId;
      return this;
    }
    @Override
    public CommentContextKey.Builder id(String id) {
      if (id == null) {
        throw new NullPointerException("Null id");
      }
      this.id = id;
      return this;
    }
    @Override
    public CommentContextKey.Builder path(String path) {
      if (path == null) {
        throw new NullPointerException("Null path");
      }
      this.path = path;
      return this;
    }
    @Override
    public CommentContextKey.Builder patchset(int patchset) {
      this.patchset = patchset;
      set$0 |= (byte) 1;
      return this;
    }
    @Override
    public CommentContextKey.Builder contextPadding(int contextPadding) {
      this.contextPadding = contextPadding;
      set$0 |= (byte) 2;
      return this;
    }
    @Override
    public CommentContextKey build() {
      if (set$0 != 3
          || this.project == null
          || this.changeId == null
          || this.id == null
          || this.path == null) {
        StringBuilder missing = new StringBuilder();
        if (this.project == null) {
          missing.append(" project");
        }
        if (this.changeId == null) {
          missing.append(" changeId");
        }
        if (this.id == null) {
          missing.append(" id");
        }
        if (this.path == null) {
          missing.append(" path");
        }
        if ((set$0 & 1) == 0) {
          missing.append(" patchset");
        }
        if ((set$0 & 2) == 0) {
          missing.append(" contextPadding");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_CommentContextKey(
          this.project,
          this.changeId,
          this.id,
          this.path,
          this.patchset,
          this.contextPadding);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy