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

com.google.common.truth.extensions.proto.$AutoValue_DiffResult_SingularField Maven / Gradle / Ivy

The newest version!
package com.google.common.truth.extensions.proto;

import com.google.common.base.Optional;
import com.google.protobuf.TextFormat;

// Generated by com.google.auto.value.processor.AutoValueProcessor
abstract class $AutoValue_DiffResult_SingularField extends DiffResult.SingularField {

  private final TextFormat.Printer protoPrinter;

  private final RecursableDiffEntity.WithResultCode.Result result;

  private final Optional subScopeId;

  private final String fieldName;

  private final Optional actual;

  private final Optional expected;

  private final Optional breakdown;

  private final Optional unknownsBreakdown;

  $AutoValue_DiffResult_SingularField(
      TextFormat.Printer protoPrinter,
      RecursableDiffEntity.WithResultCode.Result result,
      Optional subScopeId,
      String fieldName,
      Optional actual,
      Optional expected,
      Optional breakdown,
      Optional unknownsBreakdown) {
    if (protoPrinter == null) {
      throw new NullPointerException("Null protoPrinter");
    }
    this.protoPrinter = protoPrinter;
    if (result == null) {
      throw new NullPointerException("Null result");
    }
    this.result = result;
    if (subScopeId == null) {
      throw new NullPointerException("Null subScopeId");
    }
    this.subScopeId = subScopeId;
    if (fieldName == null) {
      throw new NullPointerException("Null fieldName");
    }
    this.fieldName = fieldName;
    if (actual == null) {
      throw new NullPointerException("Null actual");
    }
    this.actual = actual;
    if (expected == null) {
      throw new NullPointerException("Null expected");
    }
    this.expected = expected;
    if (breakdown == null) {
      throw new NullPointerException("Null breakdown");
    }
    this.breakdown = breakdown;
    if (unknownsBreakdown == null) {
      throw new NullPointerException("Null unknownsBreakdown");
    }
    this.unknownsBreakdown = unknownsBreakdown;
  }

  @Override
  public TextFormat.Printer protoPrinter() {
    return protoPrinter;
  }

  @Override
  RecursableDiffEntity.WithResultCode.Result result() {
    return result;
  }

  @Override
  Optional subScopeId() {
    return subScopeId;
  }

  @Override
  String fieldName() {
    return fieldName;
  }

  @Override
  Optional actual() {
    return actual;
  }

  @Override
  Optional expected() {
    return expected;
  }

  @Override
  Optional breakdown() {
    return breakdown;
  }

  @Override
  Optional unknownsBreakdown() {
    return unknownsBreakdown;
  }

  @Override
  public String toString() {
    return "SingularField{"
        + "protoPrinter=" + protoPrinter + ", "
        + "result=" + result + ", "
        + "subScopeId=" + subScopeId + ", "
        + "fieldName=" + fieldName + ", "
        + "actual=" + actual + ", "
        + "expected=" + expected + ", "
        + "breakdown=" + breakdown + ", "
        + "unknownsBreakdown=" + unknownsBreakdown
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof DiffResult.SingularField) {
      DiffResult.SingularField that = (DiffResult.SingularField) o;
      return this.protoPrinter.equals(that.protoPrinter())
          && this.result.equals(that.result())
          && this.subScopeId.equals(that.subScopeId())
          && this.fieldName.equals(that.fieldName())
          && this.actual.equals(that.actual())
          && this.expected.equals(that.expected())
          && this.breakdown.equals(that.breakdown())
          && this.unknownsBreakdown.equals(that.unknownsBreakdown());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= protoPrinter.hashCode();
    h$ *= 1000003;
    h$ ^= result.hashCode();
    h$ *= 1000003;
    h$ ^= subScopeId.hashCode();
    h$ *= 1000003;
    h$ ^= fieldName.hashCode();
    h$ *= 1000003;
    h$ ^= actual.hashCode();
    h$ *= 1000003;
    h$ ^= expected.hashCode();
    h$ *= 1000003;
    h$ ^= breakdown.hashCode();
    h$ *= 1000003;
    h$ ^= unknownsBreakdown.hashCode();
    return h$;
  }

  static class Builder extends DiffResult.SingularField.Builder {
    private TextFormat.Printer protoPrinter;
    private RecursableDiffEntity.WithResultCode.Result result;
    private Optional subScopeId = Optional.absent();
    private String fieldName;
    private Optional actual = Optional.absent();
    private Optional expected = Optional.absent();
    private Optional breakdown = Optional.absent();
    private Optional unknownsBreakdown = Optional.absent();
    Builder() {
    }
    @Override
    DiffResult.SingularField.Builder setProtoPrinter(TextFormat.Printer protoPrinter) {
      if (protoPrinter == null) {
        throw new NullPointerException("Null protoPrinter");
      }
      this.protoPrinter = protoPrinter;
      return this;
    }
    @Override
    DiffResult.SingularField.Builder setResult(RecursableDiffEntity.WithResultCode.Result result) {
      if (result == null) {
        throw new NullPointerException("Null result");
      }
      this.result = result;
      return this;
    }
    @Override
    DiffResult.SingularField.Builder setSubScopeId(SubScopeId subScopeId) {
      this.subScopeId = Optional.of(subScopeId);
      return this;
    }
    @Override
    DiffResult.SingularField.Builder setFieldName(String fieldName) {
      if (fieldName == null) {
        throw new NullPointerException("Null fieldName");
      }
      this.fieldName = fieldName;
      return this;
    }
    @Override
    DiffResult.SingularField.Builder setActual(Object actual) {
      this.actual = Optional.of(actual);
      return this;
    }
    @Override
    DiffResult.SingularField.Builder setExpected(Object expected) {
      this.expected = Optional.of(expected);
      return this;
    }
    @Override
    DiffResult.SingularField.Builder setBreakdown(DiffResult breakdown) {
      this.breakdown = Optional.of(breakdown);
      return this;
    }
    @Override
    DiffResult.SingularField.Builder setUnknownsBreakdown(DiffResult.UnknownFieldSetDiff unknownsBreakdown) {
      this.unknownsBreakdown = Optional.of(unknownsBreakdown);
      return this;
    }
    @Override
    DiffResult.SingularField build() {
      if (this.protoPrinter == null
          || this.result == null
          || this.fieldName == null) {
        StringBuilder missing = new StringBuilder();
        if (this.protoPrinter == null) {
          missing.append(" protoPrinter");
        }
        if (this.result == null) {
          missing.append(" result");
        }
        if (this.fieldName == null) {
          missing.append(" fieldName");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_DiffResult_SingularField(
          this.protoPrinter,
          this.result,
          this.subScopeId,
          this.fieldName,
          this.actual,
          this.expected,
          this.breakdown,
          this.unknownsBreakdown);
    }
  }

}