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

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

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

import com.google.common.base.Optional;
import com.google.common.collect.ImmutableListMultimap;
import com.google.protobuf.UnknownFieldSet;

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

  private final Optional actual;

  private final Optional expected;

  private final ImmutableListMultimap singularFields;

  $AutoValue_DiffResult_UnknownFieldSetDiff(
      Optional actual,
      Optional expected,
      ImmutableListMultimap singularFields) {
    if (actual == null) {
      throw new NullPointerException("Null actual");
    }
    this.actual = actual;
    if (expected == null) {
      throw new NullPointerException("Null expected");
    }
    this.expected = expected;
    if (singularFields == null) {
      throw new NullPointerException("Null singularFields");
    }
    this.singularFields = singularFields;
  }

  @Override
  Optional actual() {
    return actual;
  }

  @Override
  Optional expected() {
    return expected;
  }

  @Override
  ImmutableListMultimap singularFields() {
    return singularFields;
  }

  @Override
  public String toString() {
    return "UnknownFieldSetDiff{"
        + "actual=" + actual + ", "
        + "expected=" + expected + ", "
        + "singularFields=" + singularFields
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof DiffResult.UnknownFieldSetDiff) {
      DiffResult.UnknownFieldSetDiff that = (DiffResult.UnknownFieldSetDiff) o;
      return this.actual.equals(that.actual())
          && this.expected.equals(that.expected())
          && this.singularFields.equals(that.singularFields());
    }
    return false;
  }

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

  static class Builder extends DiffResult.UnknownFieldSetDiff.Builder {
    private Optional actual = Optional.absent();
    private Optional expected = Optional.absent();
    private ImmutableListMultimap.Builder singularFieldsBuilder$;
    private ImmutableListMultimap singularFields;
    Builder() {
    }
    @Override
    DiffResult.UnknownFieldSetDiff.Builder setActual(UnknownFieldSet actual) {
      this.actual = Optional.of(actual);
      return this;
    }
    @Override
    DiffResult.UnknownFieldSetDiff.Builder setExpected(UnknownFieldSet expected) {
      this.expected = Optional.of(expected);
      return this;
    }
    @Override
    ImmutableListMultimap.Builder singularFieldsBuilder() {
      if (singularFieldsBuilder$ == null) {
        singularFieldsBuilder$ = new ImmutableListMultimap.Builder();
      }
      return singularFieldsBuilder$;
    }
    @Override
    DiffResult.UnknownFieldSetDiff build() {
      if (singularFieldsBuilder$ != null) {
        this.singularFields = singularFieldsBuilder$.build();
      } else if (this.singularFields == null) {
        this.singularFields = ImmutableListMultimap.of();
      }
      return new AutoValue_DiffResult_UnknownFieldSetDiff(
          this.actual,
          this.expected,
          this.singularFields);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy