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

com.google.gerrit.entities.AutoValue_PatchSet Maven / Gradle / Ivy

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

import com.google.common.collect.ImmutableList;
import java.time.Instant;
import java.util.Optional;
import javax.annotation.processing.Generated;
import org.eclipse.jgit.lib.ObjectId;

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

  private final PatchSet.Id id;

  private final ObjectId commitId;

  private final Optional branch;

  private final Account.Id uploader;

  private final Account.Id realUploader;

  private final Instant createdOn;

  private final ImmutableList groups;

  private final Optional pushCertificate;

  private final Optional description;

  private AutoValue_PatchSet(
      PatchSet.Id id,
      ObjectId commitId,
      Optional branch,
      Account.Id uploader,
      Account.Id realUploader,
      Instant createdOn,
      ImmutableList groups,
      Optional pushCertificate,
      Optional description) {
    this.id = id;
    this.commitId = commitId;
    this.branch = branch;
    this.uploader = uploader;
    this.realUploader = realUploader;
    this.createdOn = createdOn;
    this.groups = groups;
    this.pushCertificate = pushCertificate;
    this.description = description;
  }

  @Override
  public PatchSet.Id id() {
    return id;
  }

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

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

  @Override
  public Account.Id uploader() {
    return uploader;
  }

  @Override
  public Account.Id realUploader() {
    return realUploader;
  }

  @Override
  public Instant createdOn() {
    return createdOn;
  }

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

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

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

  @Override
  public String toString() {
    return "PatchSet{"
        + "id=" + id + ", "
        + "commitId=" + commitId + ", "
        + "branch=" + branch + ", "
        + "uploader=" + uploader + ", "
        + "realUploader=" + realUploader + ", "
        + "createdOn=" + createdOn + ", "
        + "groups=" + groups + ", "
        + "pushCertificate=" + pushCertificate + ", "
        + "description=" + description
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof PatchSet) {
      PatchSet that = (PatchSet) o;
      return this.id.equals(that.id())
          && this.commitId.equals(that.commitId())
          && this.branch.equals(that.branch())
          && this.uploader.equals(that.uploader())
          && this.realUploader.equals(that.realUploader())
          && this.createdOn.equals(that.createdOn())
          && this.groups.equals(that.groups())
          && this.pushCertificate.equals(that.pushCertificate())
          && this.description.equals(that.description());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= id.hashCode();
    h$ *= 1000003;
    h$ ^= commitId.hashCode();
    h$ *= 1000003;
    h$ ^= branch.hashCode();
    h$ *= 1000003;
    h$ ^= uploader.hashCode();
    h$ *= 1000003;
    h$ ^= realUploader.hashCode();
    h$ *= 1000003;
    h$ ^= createdOn.hashCode();
    h$ *= 1000003;
    h$ ^= groups.hashCode();
    h$ *= 1000003;
    h$ ^= pushCertificate.hashCode();
    h$ *= 1000003;
    h$ ^= description.hashCode();
    return h$;
  }

  static final class Builder extends PatchSet.Builder {
    private PatchSet.Id id;
    private ObjectId commitId;
    private Optional branch = Optional.empty();
    private Account.Id uploader;
    private Account.Id realUploader;
    private Instant createdOn;
    private ImmutableList groups;
    private Optional pushCertificate = Optional.empty();
    private Optional description = Optional.empty();
    Builder() {
    }
    @Override
    public PatchSet.Builder id(PatchSet.Id id) {
      if (id == null) {
        throw new NullPointerException("Null id");
      }
      this.id = id;
      return this;
    }
    @Override
    public PatchSet.Id id() {
      if (this.id == null) {
        throw new IllegalStateException("Property \"id\" has not been set");
      }
      return id;
    }
    @Override
    public PatchSet.Builder commitId(ObjectId commitId) {
      if (commitId == null) {
        throw new NullPointerException("Null commitId");
      }
      this.commitId = commitId;
      return this;
    }
    @Override
    public Optional commitId() {
      if (this.commitId == null) {
        return Optional.empty();
      }
      return Optional.of(commitId);
    }
    @Override
    public PatchSet.Builder branch(Optional branch) {
      if (branch == null) {
        throw new NullPointerException("Null branch");
      }
      this.branch = branch;
      return this;
    }
    @Override
    public PatchSet.Builder branch(String branch) {
      this.branch = Optional.of(branch);
      return this;
    }
    @Override
    public PatchSet.Builder uploader(Account.Id uploader) {
      if (uploader == null) {
        throw new NullPointerException("Null uploader");
      }
      this.uploader = uploader;
      return this;
    }
    @Override
    public PatchSet.Builder realUploader(Account.Id realUploader) {
      if (realUploader == null) {
        throw new NullPointerException("Null realUploader");
      }
      this.realUploader = realUploader;
      return this;
    }
    @Override
    public PatchSet.Builder createdOn(Instant createdOn) {
      if (createdOn == null) {
        throw new NullPointerException("Null createdOn");
      }
      this.createdOn = createdOn;
      return this;
    }
    @Override
    public PatchSet.Builder groups(Iterable groups) {
      this.groups = ImmutableList.copyOf(groups);
      return this;
    }
    @Override
    public ImmutableList groups() {
      if (this.groups == null) {
        throw new IllegalStateException("Property \"groups\" has not been set");
      }
      return groups;
    }
    @Override
    public PatchSet.Builder pushCertificate(Optional pushCertificate) {
      if (pushCertificate == null) {
        throw new NullPointerException("Null pushCertificate");
      }
      this.pushCertificate = pushCertificate;
      return this;
    }
    @Override
    public PatchSet.Builder pushCertificate(String pushCertificate) {
      this.pushCertificate = Optional.of(pushCertificate);
      return this;
    }
    @Override
    public PatchSet.Builder description(Optional description) {
      if (description == null) {
        throw new NullPointerException("Null description");
      }
      this.description = description;
      return this;
    }
    @Override
    public PatchSet.Builder description(String description) {
      this.description = Optional.of(description);
      return this;
    }
    @Override
    public Optional description() {
      return description;
    }
    @Override
    public PatchSet build() {
      if (this.id == null
          || this.commitId == null
          || this.uploader == null
          || this.realUploader == null
          || this.createdOn == null
          || this.groups == null) {
        StringBuilder missing = new StringBuilder();
        if (this.id == null) {
          missing.append(" id");
        }
        if (this.commitId == null) {
          missing.append(" commitId");
        }
        if (this.uploader == null) {
          missing.append(" uploader");
        }
        if (this.realUploader == null) {
          missing.append(" realUploader");
        }
        if (this.createdOn == null) {
          missing.append(" createdOn");
        }
        if (this.groups == null) {
          missing.append(" groups");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_PatchSet(
          this.id,
          this.commitId,
          this.branch,
          this.uploader,
          this.realUploader,
          this.createdOn,
          this.groups,
          this.pushCertificate,
          this.description);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy