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

org.graylog2.lookup.adapters.$AutoValue_HTTPJSONPathDataAdapter_Config Maven / Gradle / Ivy

There is a newer version: 6.0.6
Show newest version

package org.graylog2.lookup.adapters;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import javax.validation.constraints.NotEmpty;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
 abstract class $AutoValue_HTTPJSONPathDataAdapter_Config extends HTTPJSONPathDataAdapter.Config {

  private final String type;
  private final @NotEmpty String url;
  private final @NotEmpty String singleValueJSONPath;
  private final Optional multiValueJSONPath;
  private final @NotEmpty String userAgent;
  private final Map headers;

  $AutoValue_HTTPJSONPathDataAdapter_Config(
      String type,
      @NotEmpty String url,
      @NotEmpty String singleValueJSONPath,
      Optional multiValueJSONPath,
      @NotEmpty String userAgent,
      @Nullable Map headers) {
    if (type == null) {
      throw new NullPointerException("Null type");
    }
    this.type = type;
    if (url == null) {
      throw new NullPointerException("Null url");
    }
    this.url = url;
    if (singleValueJSONPath == null) {
      throw new NullPointerException("Null singleValueJSONPath");
    }
    this.singleValueJSONPath = singleValueJSONPath;
    if (multiValueJSONPath == null) {
      throw new NullPointerException("Null multiValueJSONPath");
    }
    this.multiValueJSONPath = multiValueJSONPath;
    if (userAgent == null) {
      throw new NullPointerException("Null userAgent");
    }
    this.userAgent = userAgent;
    this.headers = headers;
  }

  @JsonProperty(value = "type")
  @Override
  public String type() {
    return type;
  }

  @JsonProperty(value = "url")
  @Override
  public @NotEmpty String url() {
    return url;
  }

  @JsonProperty(value = "single_value_jsonpath")
  @Override
  public @NotEmpty String singleValueJSONPath() {
    return singleValueJSONPath;
  }

  @JsonProperty(value = "multi_value_jsonpath")
  @Override
  public Optional multiValueJSONPath() {
    return multiValueJSONPath;
  }

  @JsonProperty(value = "user_agent")
  @Override
  public @NotEmpty String userAgent() {
    return userAgent;
  }

  @JsonProperty(value = "headers")
  @Nullable
  @Override
  public Map headers() {
    return headers;
  }

  @Override
  public String toString() {
    return "Config{"
        + "type=" + type + ", "
        + "url=" + url + ", "
        + "singleValueJSONPath=" + singleValueJSONPath + ", "
        + "multiValueJSONPath=" + multiValueJSONPath + ", "
        + "userAgent=" + userAgent + ", "
        + "headers=" + headers
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof HTTPJSONPathDataAdapter.Config) {
      HTTPJSONPathDataAdapter.Config that = (HTTPJSONPathDataAdapter.Config) o;
      return (this.type.equals(that.type()))
           && (this.url.equals(that.url()))
           && (this.singleValueJSONPath.equals(that.singleValueJSONPath()))
           && (this.multiValueJSONPath.equals(that.multiValueJSONPath()))
           && (this.userAgent.equals(that.userAgent()))
           && ((this.headers == null) ? (that.headers() == null) : this.headers.equals(that.headers()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h = 1;
    h *= 1000003;
    h ^= this.type.hashCode();
    h *= 1000003;
    h ^= this.url.hashCode();
    h *= 1000003;
    h ^= this.singleValueJSONPath.hashCode();
    h *= 1000003;
    h ^= this.multiValueJSONPath.hashCode();
    h *= 1000003;
    h ^= this.userAgent.hashCode();
    h *= 1000003;
    h ^= (headers == null) ? 0 : this.headers.hashCode();
    return h;
  }

  static final class Builder extends HTTPJSONPathDataAdapter.Config.Builder {
    private String type;
    private @NotEmpty String url;
    private @NotEmpty String singleValueJSONPath;
    private Optional multiValueJSONPath = Optional.empty();
    private @NotEmpty String userAgent;
    private Map headers;
    Builder() {
    }
    @Override
    public HTTPJSONPathDataAdapter.Config.Builder type(String type) {
      if (type == null) {
        throw new NullPointerException("Null type");
      }
      this.type = type;
      return this;
    }
    @Override
    public HTTPJSONPathDataAdapter.Config.Builder url(String url) {
      if (url == null) {
        throw new NullPointerException("Null url");
      }
      this.url = url;
      return this;
    }
    @Override
    public HTTPJSONPathDataAdapter.Config.Builder singleValueJSONPath(String singleValueJSONPath) {
      if (singleValueJSONPath == null) {
        throw new NullPointerException("Null singleValueJSONPath");
      }
      this.singleValueJSONPath = singleValueJSONPath;
      return this;
    }
    @Override
    public HTTPJSONPathDataAdapter.Config.Builder multiValueJSONPath(String multiValueJSONPath) {
      if (multiValueJSONPath == null) {
        throw new NullPointerException("Null multiValueJSONPath");
      }
      this.multiValueJSONPath = Optional.of(multiValueJSONPath);
      return this;
    }
    @Override
    public HTTPJSONPathDataAdapter.Config.Builder userAgent(String userAgent) {
      if (userAgent == null) {
        throw new NullPointerException("Null userAgent");
      }
      this.userAgent = userAgent;
      return this;
    }
    @Override
    public HTTPJSONPathDataAdapter.Config.Builder headers(@Nullable Map headers) {
      this.headers = headers;
      return this;
    }
    @Override
    public HTTPJSONPathDataAdapter.Config build() {
      String missing = "";
      if (this.type == null) {
        missing += " type";
      }
      if (this.url == null) {
        missing += " url";
      }
      if (this.singleValueJSONPath == null) {
        missing += " singleValueJSONPath";
      }
      if (this.userAgent == null) {
        missing += " userAgent";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_HTTPJSONPathDataAdapter_Config(
          this.type,
          this.url,
          this.singleValueJSONPath,
          this.multiValueJSONPath,
          this.userAgent,
          this.headers);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy