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

com.google.common.truth.extensions.proto.AutoValue_FluentEqualityConfig Maven / Gradle / Ivy

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

import com.google.common.base.Function;
import com.google.common.base.Optional;
import com.google.common.truth.Correspondence;
import com.google.protobuf.Descriptors;
import com.google.protobuf.ExtensionRegistry;
import com.google.protobuf.TypeRegistry;

// Generated by com.google.auto.value.processor.AutoValueProcessor
final class AutoValue_FluentEqualityConfig extends FluentEqualityConfig {

  private final FieldScopeLogic ignoreFieldAbsenceScope;

  private final FieldScopeLogic ignoreRepeatedFieldOrderScope;

  private final FieldScopeLogic ignoreExtraRepeatedFieldElementsScope;

  private final FieldScopeLogicMap> doubleCorrespondenceMap;

  private final FieldScopeLogicMap> floatCorrespondenceMap;

  private final boolean compareExpectedFieldsOnly;

  private final boolean hasExpectedMessages;

  private final FieldScopeLogic compareFieldsScope;

  private final boolean reportMismatchesOnly;

  private final TypeRegistry useTypeRegistry;

  private final ExtensionRegistry useExtensionRegistry;

  private final Function, String> usingCorrespondenceStringFunction;

  private AutoValue_FluentEqualityConfig(
      FieldScopeLogic ignoreFieldAbsenceScope,
      FieldScopeLogic ignoreRepeatedFieldOrderScope,
      FieldScopeLogic ignoreExtraRepeatedFieldElementsScope,
      FieldScopeLogicMap> doubleCorrespondenceMap,
      FieldScopeLogicMap> floatCorrespondenceMap,
      boolean compareExpectedFieldsOnly,
      boolean hasExpectedMessages,
      FieldScopeLogic compareFieldsScope,
      boolean reportMismatchesOnly,
      TypeRegistry useTypeRegistry,
      ExtensionRegistry useExtensionRegistry,
      Function, String> usingCorrespondenceStringFunction) {
    this.ignoreFieldAbsenceScope = ignoreFieldAbsenceScope;
    this.ignoreRepeatedFieldOrderScope = ignoreRepeatedFieldOrderScope;
    this.ignoreExtraRepeatedFieldElementsScope = ignoreExtraRepeatedFieldElementsScope;
    this.doubleCorrespondenceMap = doubleCorrespondenceMap;
    this.floatCorrespondenceMap = floatCorrespondenceMap;
    this.compareExpectedFieldsOnly = compareExpectedFieldsOnly;
    this.hasExpectedMessages = hasExpectedMessages;
    this.compareFieldsScope = compareFieldsScope;
    this.reportMismatchesOnly = reportMismatchesOnly;
    this.useTypeRegistry = useTypeRegistry;
    this.useExtensionRegistry = useExtensionRegistry;
    this.usingCorrespondenceStringFunction = usingCorrespondenceStringFunction;
  }

  @Override
  FieldScopeLogic ignoreFieldAbsenceScope() {
    return ignoreFieldAbsenceScope;
  }

  @Override
  FieldScopeLogic ignoreRepeatedFieldOrderScope() {
    return ignoreRepeatedFieldOrderScope;
  }

  @Override
  FieldScopeLogic ignoreExtraRepeatedFieldElementsScope() {
    return ignoreExtraRepeatedFieldElementsScope;
  }

  @Override
  FieldScopeLogicMap> doubleCorrespondenceMap() {
    return doubleCorrespondenceMap;
  }

  @Override
  FieldScopeLogicMap> floatCorrespondenceMap() {
    return floatCorrespondenceMap;
  }

  @Override
  boolean compareExpectedFieldsOnly() {
    return compareExpectedFieldsOnly;
  }

  @Override
  boolean hasExpectedMessages() {
    return hasExpectedMessages;
  }

  @Override
  FieldScopeLogic compareFieldsScope() {
    return compareFieldsScope;
  }

  @Override
  boolean reportMismatchesOnly() {
    return reportMismatchesOnly;
  }

  @Override
  TypeRegistry useTypeRegistry() {
    return useTypeRegistry;
  }

  @Override
  ExtensionRegistry useExtensionRegistry() {
    return useExtensionRegistry;
  }

  @Override
  Function, String> usingCorrespondenceStringFunction() {
    return usingCorrespondenceStringFunction;
  }

  @Override
  public String toString() {
    return "FluentEqualityConfig{"
        + "ignoreFieldAbsenceScope=" + ignoreFieldAbsenceScope + ", "
        + "ignoreRepeatedFieldOrderScope=" + ignoreRepeatedFieldOrderScope + ", "
        + "ignoreExtraRepeatedFieldElementsScope=" + ignoreExtraRepeatedFieldElementsScope + ", "
        + "doubleCorrespondenceMap=" + doubleCorrespondenceMap + ", "
        + "floatCorrespondenceMap=" + floatCorrespondenceMap + ", "
        + "compareExpectedFieldsOnly=" + compareExpectedFieldsOnly + ", "
        + "hasExpectedMessages=" + hasExpectedMessages + ", "
        + "compareFieldsScope=" + compareFieldsScope + ", "
        + "reportMismatchesOnly=" + reportMismatchesOnly + ", "
        + "useTypeRegistry=" + useTypeRegistry + ", "
        + "useExtensionRegistry=" + useExtensionRegistry + ", "
        + "usingCorrespondenceStringFunction=" + usingCorrespondenceStringFunction
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof FluentEqualityConfig) {
      FluentEqualityConfig that = (FluentEqualityConfig) o;
      return this.ignoreFieldAbsenceScope.equals(that.ignoreFieldAbsenceScope())
          && this.ignoreRepeatedFieldOrderScope.equals(that.ignoreRepeatedFieldOrderScope())
          && this.ignoreExtraRepeatedFieldElementsScope.equals(that.ignoreExtraRepeatedFieldElementsScope())
          && this.doubleCorrespondenceMap.equals(that.doubleCorrespondenceMap())
          && this.floatCorrespondenceMap.equals(that.floatCorrespondenceMap())
          && this.compareExpectedFieldsOnly == that.compareExpectedFieldsOnly()
          && this.hasExpectedMessages == that.hasExpectedMessages()
          && this.compareFieldsScope.equals(that.compareFieldsScope())
          && this.reportMismatchesOnly == that.reportMismatchesOnly()
          && this.useTypeRegistry.equals(that.useTypeRegistry())
          && this.useExtensionRegistry.equals(that.useExtensionRegistry())
          && this.usingCorrespondenceStringFunction.equals(that.usingCorrespondenceStringFunction());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= ignoreFieldAbsenceScope.hashCode();
    h$ *= 1000003;
    h$ ^= ignoreRepeatedFieldOrderScope.hashCode();
    h$ *= 1000003;
    h$ ^= ignoreExtraRepeatedFieldElementsScope.hashCode();
    h$ *= 1000003;
    h$ ^= doubleCorrespondenceMap.hashCode();
    h$ *= 1000003;
    h$ ^= floatCorrespondenceMap.hashCode();
    h$ *= 1000003;
    h$ ^= compareExpectedFieldsOnly ? 1231 : 1237;
    h$ *= 1000003;
    h$ ^= hasExpectedMessages ? 1231 : 1237;
    h$ *= 1000003;
    h$ ^= compareFieldsScope.hashCode();
    h$ *= 1000003;
    h$ ^= reportMismatchesOnly ? 1231 : 1237;
    h$ *= 1000003;
    h$ ^= useTypeRegistry.hashCode();
    h$ *= 1000003;
    h$ ^= useExtensionRegistry.hashCode();
    h$ *= 1000003;
    h$ ^= usingCorrespondenceStringFunction.hashCode();
    return h$;
  }

  @Override
  FluentEqualityConfig.Builder toBuilder() {
    return new AutoValue_FluentEqualityConfig.Builder(this);
  }

  static final class Builder extends FluentEqualityConfig.Builder {
    private FieldScopeLogic ignoreFieldAbsenceScope;
    private FieldScopeLogic ignoreRepeatedFieldOrderScope;
    private FieldScopeLogic ignoreExtraRepeatedFieldElementsScope;
    private FieldScopeLogicMap> doubleCorrespondenceMap;
    private FieldScopeLogicMap> floatCorrespondenceMap;
    private boolean compareExpectedFieldsOnly;
    private boolean hasExpectedMessages;
    private FieldScopeLogic compareFieldsScope;
    private boolean reportMismatchesOnly;
    private TypeRegistry useTypeRegistry;
    private ExtensionRegistry useExtensionRegistry;
    private Function, String> usingCorrespondenceStringFunction;
    private byte set$0;
    Builder() {
    }
    Builder(FluentEqualityConfig source) {
      this.ignoreFieldAbsenceScope = source.ignoreFieldAbsenceScope();
      this.ignoreRepeatedFieldOrderScope = source.ignoreRepeatedFieldOrderScope();
      this.ignoreExtraRepeatedFieldElementsScope = source.ignoreExtraRepeatedFieldElementsScope();
      this.doubleCorrespondenceMap = source.doubleCorrespondenceMap();
      this.floatCorrespondenceMap = source.floatCorrespondenceMap();
      this.compareExpectedFieldsOnly = source.compareExpectedFieldsOnly();
      this.hasExpectedMessages = source.hasExpectedMessages();
      this.compareFieldsScope = source.compareFieldsScope();
      this.reportMismatchesOnly = source.reportMismatchesOnly();
      this.useTypeRegistry = source.useTypeRegistry();
      this.useExtensionRegistry = source.useExtensionRegistry();
      this.usingCorrespondenceStringFunction = source.usingCorrespondenceStringFunction();
      set$0 = (byte) 7;
    }
    @Override
    FluentEqualityConfig.Builder setIgnoreFieldAbsenceScope(FieldScopeLogic ignoreFieldAbsenceScope) {
      if (ignoreFieldAbsenceScope == null) {
        throw new NullPointerException("Null ignoreFieldAbsenceScope");
      }
      this.ignoreFieldAbsenceScope = ignoreFieldAbsenceScope;
      return this;
    }
    @Override
    FluentEqualityConfig.Builder setIgnoreRepeatedFieldOrderScope(FieldScopeLogic ignoreRepeatedFieldOrderScope) {
      if (ignoreRepeatedFieldOrderScope == null) {
        throw new NullPointerException("Null ignoreRepeatedFieldOrderScope");
      }
      this.ignoreRepeatedFieldOrderScope = ignoreRepeatedFieldOrderScope;
      return this;
    }
    @Override
    FluentEqualityConfig.Builder setIgnoreExtraRepeatedFieldElementsScope(FieldScopeLogic ignoreExtraRepeatedFieldElementsScope) {
      if (ignoreExtraRepeatedFieldElementsScope == null) {
        throw new NullPointerException("Null ignoreExtraRepeatedFieldElementsScope");
      }
      this.ignoreExtraRepeatedFieldElementsScope = ignoreExtraRepeatedFieldElementsScope;
      return this;
    }
    @Override
    FluentEqualityConfig.Builder setDoubleCorrespondenceMap(FieldScopeLogicMap> doubleCorrespondenceMap) {
      if (doubleCorrespondenceMap == null) {
        throw new NullPointerException("Null doubleCorrespondenceMap");
      }
      this.doubleCorrespondenceMap = doubleCorrespondenceMap;
      return this;
    }
    @Override
    FluentEqualityConfig.Builder setFloatCorrespondenceMap(FieldScopeLogicMap> floatCorrespondenceMap) {
      if (floatCorrespondenceMap == null) {
        throw new NullPointerException("Null floatCorrespondenceMap");
      }
      this.floatCorrespondenceMap = floatCorrespondenceMap;
      return this;
    }
    @Override
    FluentEqualityConfig.Builder setCompareExpectedFieldsOnly(boolean compareExpectedFieldsOnly) {
      this.compareExpectedFieldsOnly = compareExpectedFieldsOnly;
      set$0 |= (byte) 1;
      return this;
    }
    @Override
    FluentEqualityConfig.Builder setHasExpectedMessages(boolean hasExpectedMessages) {
      this.hasExpectedMessages = hasExpectedMessages;
      set$0 |= (byte) 2;
      return this;
    }
    @Override
    FluentEqualityConfig.Builder setCompareFieldsScope(FieldScopeLogic compareFieldsScope) {
      if (compareFieldsScope == null) {
        throw new NullPointerException("Null compareFieldsScope");
      }
      this.compareFieldsScope = compareFieldsScope;
      return this;
    }
    @Override
    FluentEqualityConfig.Builder setReportMismatchesOnly(boolean reportMismatchesOnly) {
      this.reportMismatchesOnly = reportMismatchesOnly;
      set$0 |= (byte) 4;
      return this;
    }
    @Override
    FluentEqualityConfig.Builder setUseTypeRegistry(TypeRegistry useTypeRegistry) {
      if (useTypeRegistry == null) {
        throw new NullPointerException("Null useTypeRegistry");
      }
      this.useTypeRegistry = useTypeRegistry;
      return this;
    }
    @Override
    FluentEqualityConfig.Builder setUseExtensionRegistry(ExtensionRegistry useExtensionRegistry) {
      if (useExtensionRegistry == null) {
        throw new NullPointerException("Null useExtensionRegistry");
      }
      this.useExtensionRegistry = useExtensionRegistry;
      return this;
    }
    @Override
    FluentEqualityConfig.Builder setUsingCorrespondenceStringFunction(Function, String> usingCorrespondenceStringFunction) {
      if (usingCorrespondenceStringFunction == null) {
        throw new NullPointerException("Null usingCorrespondenceStringFunction");
      }
      this.usingCorrespondenceStringFunction = usingCorrespondenceStringFunction;
      return this;
    }
    @Override
    Function, String> usingCorrespondenceStringFunction() {
      if (this.usingCorrespondenceStringFunction == null) {
        throw new IllegalStateException("Property \"usingCorrespondenceStringFunction\" has not been set");
      }
      return usingCorrespondenceStringFunction;
    }
    @Override
    FluentEqualityConfig build() {
      if (set$0 != 7
          || this.ignoreFieldAbsenceScope == null
          || this.ignoreRepeatedFieldOrderScope == null
          || this.ignoreExtraRepeatedFieldElementsScope == null
          || this.doubleCorrespondenceMap == null
          || this.floatCorrespondenceMap == null
          || this.compareFieldsScope == null
          || this.useTypeRegistry == null
          || this.useExtensionRegistry == null
          || this.usingCorrespondenceStringFunction == null) {
        StringBuilder missing = new StringBuilder();
        if (this.ignoreFieldAbsenceScope == null) {
          missing.append(" ignoreFieldAbsenceScope");
        }
        if (this.ignoreRepeatedFieldOrderScope == null) {
          missing.append(" ignoreRepeatedFieldOrderScope");
        }
        if (this.ignoreExtraRepeatedFieldElementsScope == null) {
          missing.append(" ignoreExtraRepeatedFieldElementsScope");
        }
        if (this.doubleCorrespondenceMap == null) {
          missing.append(" doubleCorrespondenceMap");
        }
        if (this.floatCorrespondenceMap == null) {
          missing.append(" floatCorrespondenceMap");
        }
        if ((set$0 & 1) == 0) {
          missing.append(" compareExpectedFieldsOnly");
        }
        if ((set$0 & 2) == 0) {
          missing.append(" hasExpectedMessages");
        }
        if (this.compareFieldsScope == null) {
          missing.append(" compareFieldsScope");
        }
        if ((set$0 & 4) == 0) {
          missing.append(" reportMismatchesOnly");
        }
        if (this.useTypeRegistry == null) {
          missing.append(" useTypeRegistry");
        }
        if (this.useExtensionRegistry == null) {
          missing.append(" useExtensionRegistry");
        }
        if (this.usingCorrespondenceStringFunction == null) {
          missing.append(" usingCorrespondenceStringFunction");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_FluentEqualityConfig(
          this.ignoreFieldAbsenceScope,
          this.ignoreRepeatedFieldOrderScope,
          this.ignoreExtraRepeatedFieldElementsScope,
          this.doubleCorrespondenceMap,
          this.floatCorrespondenceMap,
          this.compareExpectedFieldsOnly,
          this.hasExpectedMessages,
          this.compareFieldsScope,
          this.reportMismatchesOnly,
          this.useTypeRegistry,
          this.useExtensionRegistry,
          this.usingCorrespondenceStringFunction);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy