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

com.google.errorprone.bugpatterns.argumentselectiondefects.AutoValue_ArgumentChangeFinder Maven / Gradle / Ivy

There is a newer version: 2.28.0
Show newest version
package com.google.errorprone.bugpatterns.argumentselectiondefects;

import com.google.common.collect.ImmutableList;
import java.util.function.Function;
import javax.annotation.Generated;

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

  private final Function distanceFunction;

  private final ImmutableList heuristics;

  private AutoValue_ArgumentChangeFinder(
      Function distanceFunction,
      ImmutableList heuristics) {
    this.distanceFunction = distanceFunction;
    this.heuristics = heuristics;
  }

  @Override
  Function distanceFunction() {
    return distanceFunction;
  }

  @Override
  ImmutableList heuristics() {
    return heuristics;
  }

  @Override
  public String toString() {
    return "ArgumentChangeFinder{"
         + "distanceFunction=" + distanceFunction + ", "
         + "heuristics=" + heuristics
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof ArgumentChangeFinder) {
      ArgumentChangeFinder that = (ArgumentChangeFinder) o;
      return this.distanceFunction.equals(that.distanceFunction())
          && this.heuristics.equals(that.heuristics());
    }
    return false;
  }

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

  static final class Builder extends ArgumentChangeFinder.Builder {
    private Function distanceFunction;
    private ImmutableList.Builder heuristicsBuilder$;
    private ImmutableList heuristics;
    Builder() {
    }
    @Override
    ArgumentChangeFinder.Builder setDistanceFunction(Function distanceFunction) {
      if (distanceFunction == null) {
        throw new NullPointerException("Null distanceFunction");
      }
      this.distanceFunction = distanceFunction;
      return this;
    }
    @Override
    ImmutableList.Builder heuristicsBuilder() {
      if (heuristicsBuilder$ == null) {
        heuristicsBuilder$ = ImmutableList.builder();
      }
      return heuristicsBuilder$;
    }
    @Override
    ArgumentChangeFinder build() {
      if (heuristicsBuilder$ != null) {
        this.heuristics = heuristicsBuilder$.build();
      } else if (this.heuristics == null) {
        this.heuristics = ImmutableList.of();
      }
      String missing = "";
      if (this.distanceFunction == null) {
        missing += " distanceFunction";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_ArgumentChangeFinder(
          this.distanceFunction,
          this.heuristics);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy