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

com.google.gerrit.server.change.AutoValue_CommentThread Maven / Gradle / Ivy

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

import com.google.common.collect.ImmutableList;
import com.google.gerrit.entities.Comment;
import java.util.List;
import javax.annotation.processing.Generated;

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

  private final ImmutableList comments;

  private AutoValue_CommentThread(
      ImmutableList comments) {
    this.comments = comments;
  }

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

  @Override
  public String toString() {
    return "CommentThread{"
        + "comments=" + comments
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof CommentThread) {
      CommentThread that = (CommentThread) o;
      return this.comments.equals(that.comments());
    }
    return false;
  }

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

  static final class Builder extends CommentThread.Builder {
    private ImmutableList.Builder commentsBuilder$;
    private ImmutableList comments;
    Builder() {
    }
    @Override
    public CommentThread.Builder comments(List comments) {
      if (commentsBuilder$ != null) {
        throw new IllegalStateException("Cannot set comments after calling commentsBuilder()");
      }
      this.comments = ImmutableList.copyOf(comments);
      return this;
    }
    @Override
    ImmutableList.Builder commentsBuilder() {
      if (commentsBuilder$ == null) {
        if (comments == null) {
          commentsBuilder$ = ImmutableList.builder();
        } else {
          commentsBuilder$ = ImmutableList.builder();
          commentsBuilder$.addAll(comments);
          comments = null;
        }
      }
      return commentsBuilder$;
    }
    @Override
    ImmutableList comments() {
      if (commentsBuilder$ != null) {
        return commentsBuilder$.build();
      }
      if (comments == null) {
        comments = ImmutableList.of();
      }
      return comments;
    }
    @Override
    CommentThread autoBuild() {
      if (commentsBuilder$ != null) {
        this.comments = commentsBuilder$.build();
      } else if (this.comments == null) {
        this.comments = ImmutableList.of();
      }
      return new AutoValue_CommentThread(
          this.comments);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy