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

com.google.gerrit.server.edit.AutoValue_CommitModification Maven / Gradle / Ivy

There is a newer version: 3.10.0-rc6
Show newest version
package com.google.gerrit.server.edit;

import com.google.common.collect.ImmutableList;
import com.google.gerrit.server.edit.tree.TreeModification;
import java.util.Optional;
import javax.annotation.processing.Generated;

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

  private final ImmutableList treeModifications;

  private final Optional newCommitMessage;

  private AutoValue_CommitModification(
      ImmutableList treeModifications,
      Optional newCommitMessage) {
    this.treeModifications = treeModifications;
    this.newCommitMessage = newCommitMessage;
  }

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

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

  @Override
  public String toString() {
    return "CommitModification{"
        + "treeModifications=" + treeModifications + ", "
        + "newCommitMessage=" + newCommitMessage
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof CommitModification) {
      CommitModification that = (CommitModification) o;
      return this.treeModifications.equals(that.treeModifications())
          && this.newCommitMessage.equals(that.newCommitMessage());
    }
    return false;
  }

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

  static final class Builder extends CommitModification.Builder {
    private ImmutableList.Builder treeModificationsBuilder$;
    private ImmutableList treeModifications;
    private Optional newCommitMessage = Optional.empty();
    Builder() {
    }
    @Override
    public CommitModification.Builder treeModifications(ImmutableList treeModifications) {
      if (treeModifications == null) {
        throw new NullPointerException("Null treeModifications");
      }
      if (treeModificationsBuilder$ != null) {
        throw new IllegalStateException("Cannot set treeModifications after calling treeModificationsBuilder()");
      }
      this.treeModifications = treeModifications;
      return this;
    }
    @Override
    ImmutableList.Builder treeModificationsBuilder() {
      if (treeModificationsBuilder$ == null) {
        if (treeModifications == null) {
          treeModificationsBuilder$ = ImmutableList.builder();
        } else {
          treeModificationsBuilder$ = ImmutableList.builder();
          treeModificationsBuilder$.addAll(treeModifications);
          treeModifications = null;
        }
      }
      return treeModificationsBuilder$;
    }
    @Override
    public CommitModification.Builder newCommitMessage(String newCommitMessage) {
      this.newCommitMessage = Optional.of(newCommitMessage);
      return this;
    }
    @Override
    public CommitModification build() {
      if (treeModificationsBuilder$ != null) {
        this.treeModifications = treeModificationsBuilder$.build();
      } else if (this.treeModifications == null) {
        this.treeModifications = ImmutableList.of();
      }
      return new AutoValue_CommitModification(
          this.treeModifications,
          this.newCommitMessage);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy