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

com.google.gerrit.entities.$AutoValue_SubmitRequirementExpressionResult 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.util.Optional;
import javax.annotation.processing.Generated;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
abstract class $AutoValue_SubmitRequirementExpressionResult extends SubmitRequirementExpressionResult {

  private final SubmitRequirementExpression expression;

  private final SubmitRequirementExpressionResult.Status status;

  private final Optional errorMessage;

  private final ImmutableList passingAtoms;

  private final ImmutableList failingAtoms;

  $AutoValue_SubmitRequirementExpressionResult(
      SubmitRequirementExpression expression,
      SubmitRequirementExpressionResult.Status status,
      Optional errorMessage,
      ImmutableList passingAtoms,
      ImmutableList failingAtoms) {
    if (expression == null) {
      throw new NullPointerException("Null expression");
    }
    this.expression = expression;
    if (status == null) {
      throw new NullPointerException("Null status");
    }
    this.status = status;
    if (errorMessage == null) {
      throw new NullPointerException("Null errorMessage");
    }
    this.errorMessage = errorMessage;
    if (passingAtoms == null) {
      throw new NullPointerException("Null passingAtoms");
    }
    this.passingAtoms = passingAtoms;
    if (failingAtoms == null) {
      throw new NullPointerException("Null failingAtoms");
    }
    this.failingAtoms = failingAtoms;
  }

  @Override
  public SubmitRequirementExpression expression() {
    return expression;
  }

  @Override
  public SubmitRequirementExpressionResult.Status status() {
    return status;
  }

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

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

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

  @Override
  public String toString() {
    return "SubmitRequirementExpressionResult{"
        + "expression=" + expression + ", "
        + "status=" + status + ", "
        + "errorMessage=" + errorMessage + ", "
        + "passingAtoms=" + passingAtoms + ", "
        + "failingAtoms=" + failingAtoms
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof SubmitRequirementExpressionResult) {
      SubmitRequirementExpressionResult that = (SubmitRequirementExpressionResult) o;
      return this.expression.equals(that.expression())
          && this.status.equals(that.status())
          && this.errorMessage.equals(that.errorMessage())
          && this.passingAtoms.equals(that.passingAtoms())
          && this.failingAtoms.equals(that.failingAtoms());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= expression.hashCode();
    h$ *= 1000003;
    h$ ^= status.hashCode();
    h$ *= 1000003;
    h$ ^= errorMessage.hashCode();
    h$ *= 1000003;
    h$ ^= passingAtoms.hashCode();
    h$ *= 1000003;
    h$ ^= failingAtoms.hashCode();
    return h$;
  }

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

  static class Builder extends SubmitRequirementExpressionResult.Builder {
    private SubmitRequirementExpression expression;
    private SubmitRequirementExpressionResult.Status status;
    private Optional errorMessage = Optional.empty();
    private ImmutableList passingAtoms;
    private ImmutableList failingAtoms;
    Builder() {
    }
    private Builder(SubmitRequirementExpressionResult source) {
      this.expression = source.expression();
      this.status = source.status();
      this.errorMessage = source.errorMessage();
      this.passingAtoms = source.passingAtoms();
      this.failingAtoms = source.failingAtoms();
    }
    @Override
    public SubmitRequirementExpressionResult.Builder expression(SubmitRequirementExpression expression) {
      if (expression == null) {
        throw new NullPointerException("Null expression");
      }
      this.expression = expression;
      return this;
    }
    @Override
    public SubmitRequirementExpressionResult.Builder status(SubmitRequirementExpressionResult.Status status) {
      if (status == null) {
        throw new NullPointerException("Null status");
      }
      this.status = status;
      return this;
    }
    @Override
    public SubmitRequirementExpressionResult.Builder errorMessage(Optional errorMessage) {
      if (errorMessage == null) {
        throw new NullPointerException("Null errorMessage");
      }
      this.errorMessage = errorMessage;
      return this;
    }
    @Override
    public SubmitRequirementExpressionResult.Builder passingAtoms(ImmutableList passingAtoms) {
      if (passingAtoms == null) {
        throw new NullPointerException("Null passingAtoms");
      }
      this.passingAtoms = passingAtoms;
      return this;
    }
    @Override
    public SubmitRequirementExpressionResult.Builder failingAtoms(ImmutableList failingAtoms) {
      if (failingAtoms == null) {
        throw new NullPointerException("Null failingAtoms");
      }
      this.failingAtoms = failingAtoms;
      return this;
    }
    @Override
    public SubmitRequirementExpressionResult build() {
      if (this.expression == null
          || this.status == null
          || this.passingAtoms == null
          || this.failingAtoms == null) {
        StringBuilder missing = new StringBuilder();
        if (this.expression == null) {
          missing.append(" expression");
        }
        if (this.status == null) {
          missing.append(" status");
        }
        if (this.passingAtoms == null) {
          missing.append(" passingAtoms");
        }
        if (this.failingAtoms == null) {
          missing.append(" failingAtoms");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_SubmitRequirementExpressionResult(
          this.expression,
          this.status,
          this.errorMessage,
          this.passingAtoms,
          this.failingAtoms);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy