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

com.google.gerrit.server.patch.gitfilediff.AutoValue_GitFileDiff Maven / Gradle / Ivy

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

import com.google.common.collect.ImmutableList;
import com.google.gerrit.entities.Patch;
import com.google.gerrit.server.patch.filediff.Edit;
import java.util.Optional;
import javax.annotation.processing.Generated;
import org.eclipse.jgit.lib.AbbreviatedObjectId;

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

  private final ImmutableList edits;

  private final String fileHeader;

  private final Optional oldPath;

  private final Optional newPath;

  private final AbbreviatedObjectId oldId;

  private final AbbreviatedObjectId newId;

  private final Optional oldMode;

  private final Optional newMode;

  private final Patch.ChangeType changeType;

  private final Optional patchType;

  private AutoValue_GitFileDiff(
      ImmutableList edits,
      String fileHeader,
      Optional oldPath,
      Optional newPath,
      AbbreviatedObjectId oldId,
      AbbreviatedObjectId newId,
      Optional oldMode,
      Optional newMode,
      Patch.ChangeType changeType,
      Optional patchType) {
    this.edits = edits;
    this.fileHeader = fileHeader;
    this.oldPath = oldPath;
    this.newPath = newPath;
    this.oldId = oldId;
    this.newId = newId;
    this.oldMode = oldMode;
    this.newMode = newMode;
    this.changeType = changeType;
    this.patchType = patchType;
  }

  @Override
  public ImmutableList edits() {
    return edits;
  }

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

  @Override
  public Optional oldPath() {
    return oldPath;
  }

  @Override
  public Optional newPath() {
    return newPath;
  }

  @Override
  public AbbreviatedObjectId oldId() {
    return oldId;
  }

  @Override
  public AbbreviatedObjectId newId() {
    return newId;
  }

  @Override
  public Optional oldMode() {
    return oldMode;
  }

  @Override
  public Optional newMode() {
    return newMode;
  }

  @Override
  public Patch.ChangeType changeType() {
    return changeType;
  }

  @Override
  public Optional patchType() {
    return patchType;
  }

  @Override
  public String toString() {
    return "GitFileDiff{"
        + "edits=" + edits + ", "
        + "fileHeader=" + fileHeader + ", "
        + "oldPath=" + oldPath + ", "
        + "newPath=" + newPath + ", "
        + "oldId=" + oldId + ", "
        + "newId=" + newId + ", "
        + "oldMode=" + oldMode + ", "
        + "newMode=" + newMode + ", "
        + "changeType=" + changeType + ", "
        + "patchType=" + patchType
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof GitFileDiff) {
      GitFileDiff that = (GitFileDiff) o;
      return this.edits.equals(that.edits())
          && this.fileHeader.equals(that.fileHeader())
          && this.oldPath.equals(that.oldPath())
          && this.newPath.equals(that.newPath())
          && this.oldId.equals(that.oldId())
          && this.newId.equals(that.newId())
          && this.oldMode.equals(that.oldMode())
          && this.newMode.equals(that.newMode())
          && this.changeType.equals(that.changeType())
          && this.patchType.equals(that.patchType());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= edits.hashCode();
    h$ *= 1000003;
    h$ ^= fileHeader.hashCode();
    h$ *= 1000003;
    h$ ^= oldPath.hashCode();
    h$ *= 1000003;
    h$ ^= newPath.hashCode();
    h$ *= 1000003;
    h$ ^= oldId.hashCode();
    h$ *= 1000003;
    h$ ^= newId.hashCode();
    h$ *= 1000003;
    h$ ^= oldMode.hashCode();
    h$ *= 1000003;
    h$ ^= newMode.hashCode();
    h$ *= 1000003;
    h$ ^= changeType.hashCode();
    h$ *= 1000003;
    h$ ^= patchType.hashCode();
    return h$;
  }

  static final class Builder extends GitFileDiff.Builder {
    private ImmutableList edits;
    private String fileHeader;
    private Optional oldPath = Optional.empty();
    private Optional newPath = Optional.empty();
    private AbbreviatedObjectId oldId;
    private AbbreviatedObjectId newId;
    private Optional oldMode = Optional.empty();
    private Optional newMode = Optional.empty();
    private Patch.ChangeType changeType;
    private Optional patchType = Optional.empty();
    Builder() {
    }
    @Override
    public GitFileDiff.Builder edits(ImmutableList edits) {
      if (edits == null) {
        throw new NullPointerException("Null edits");
      }
      this.edits = edits;
      return this;
    }
    @Override
    public GitFileDiff.Builder fileHeader(String fileHeader) {
      if (fileHeader == null) {
        throw new NullPointerException("Null fileHeader");
      }
      this.fileHeader = fileHeader;
      return this;
    }
    @Override
    public GitFileDiff.Builder oldPath(Optional oldPath) {
      if (oldPath == null) {
        throw new NullPointerException("Null oldPath");
      }
      this.oldPath = oldPath;
      return this;
    }
    @Override
    public GitFileDiff.Builder newPath(Optional newPath) {
      if (newPath == null) {
        throw new NullPointerException("Null newPath");
      }
      this.newPath = newPath;
      return this;
    }
    @Override
    public GitFileDiff.Builder oldId(AbbreviatedObjectId oldId) {
      if (oldId == null) {
        throw new NullPointerException("Null oldId");
      }
      this.oldId = oldId;
      return this;
    }
    @Override
    public GitFileDiff.Builder newId(AbbreviatedObjectId newId) {
      if (newId == null) {
        throw new NullPointerException("Null newId");
      }
      this.newId = newId;
      return this;
    }
    @Override
    public GitFileDiff.Builder oldMode(Optional oldMode) {
      if (oldMode == null) {
        throw new NullPointerException("Null oldMode");
      }
      this.oldMode = oldMode;
      return this;
    }
    @Override
    public GitFileDiff.Builder newMode(Optional newMode) {
      if (newMode == null) {
        throw new NullPointerException("Null newMode");
      }
      this.newMode = newMode;
      return this;
    }
    @Override
    public GitFileDiff.Builder changeType(Patch.ChangeType changeType) {
      if (changeType == null) {
        throw new NullPointerException("Null changeType");
      }
      this.changeType = changeType;
      return this;
    }
    @Override
    public GitFileDiff.Builder patchType(Optional patchType) {
      if (patchType == null) {
        throw new NullPointerException("Null patchType");
      }
      this.patchType = patchType;
      return this;
    }
    @Override
    public GitFileDiff build() {
      String missing = "";
      if (this.edits == null) {
        missing += " edits";
      }
      if (this.fileHeader == null) {
        missing += " fileHeader";
      }
      if (this.oldId == null) {
        missing += " oldId";
      }
      if (this.newId == null) {
        missing += " newId";
      }
      if (this.changeType == null) {
        missing += " changeType";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_GitFileDiff(
          this.edits,
          this.fileHeader,
          this.oldPath,
          this.newPath,
          this.oldId,
          this.newId,
          this.oldMode,
          this.newMode,
          this.changeType,
          this.patchType);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy