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

org.graylog.plugins.sidecar.rest.models.$AutoValue_Configuration Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
package org.graylog.plugins.sidecar.rest.models;

import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import org.mongojack.Id;
import org.mongojack.ObjectId;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
abstract class $AutoValue_Configuration extends Configuration {

  private final String id;

  private final String collectorId;

  private final String name;

  private final String color;

  private final String template;

  $AutoValue_Configuration(
      @Nullable String id,
      String collectorId,
      String name,
      String color,
      String template) {
    this.id = id;
    if (collectorId == null) {
      throw new NullPointerException("Null collectorId");
    }
    this.collectorId = collectorId;
    if (name == null) {
      throw new NullPointerException("Null name");
    }
    this.name = name;
    if (color == null) {
      throw new NullPointerException("Null color");
    }
    this.color = color;
    if (template == null) {
      throw new NullPointerException("Null template");
    }
    this.template = template;
  }

  @Id
  @ObjectId
  @Nullable
  @JsonProperty("id")
  @Override
  public String id() {
    return id;
  }

  @JsonProperty("collector_id")
  @Override
  public String collectorId() {
    return collectorId;
  }

  @JsonProperty("name")
  @Override
  public String name() {
    return name;
  }

  @JsonProperty("color")
  @Override
  public String color() {
    return color;
  }

  @JsonProperty("template")
  @Override
  public String template() {
    return template;
  }

  @Override
  public String toString() {
    return "Configuration{"
        + "id=" + id + ", "
        + "collectorId=" + collectorId + ", "
        + "name=" + name + ", "
        + "color=" + color + ", "
        + "template=" + template
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof Configuration) {
      Configuration that = (Configuration) o;
      return (this.id == null ? that.id() == null : this.id.equals(that.id()))
          && this.collectorId.equals(that.collectorId())
          && this.name.equals(that.name())
          && this.color.equals(that.color())
          && this.template.equals(that.template());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= (id == null) ? 0 : id.hashCode();
    h$ *= 1000003;
    h$ ^= collectorId.hashCode();
    h$ *= 1000003;
    h$ ^= name.hashCode();
    h$ *= 1000003;
    h$ ^= color.hashCode();
    h$ *= 1000003;
    h$ ^= template.hashCode();
    return h$;
  }

  @Override
  public Configuration.Builder toBuilder() {
    return new Builder(this);
  }

  static class Builder extends Configuration.Builder {
    private String id;
    private String collectorId;
    private String name;
    private String color;
    private String template;
    Builder() {
    }
    private Builder(Configuration source) {
      this.id = source.id();
      this.collectorId = source.collectorId();
      this.name = source.name();
      this.color = source.color();
      this.template = source.template();
    }
    @Override
    public Configuration.Builder id(String id) {
      this.id = id;
      return this;
    }
    @Override
    public Configuration.Builder collectorId(String collectorId) {
      if (collectorId == null) {
        throw new NullPointerException("Null collectorId");
      }
      this.collectorId = collectorId;
      return this;
    }
    @Override
    public Configuration.Builder name(String name) {
      if (name == null) {
        throw new NullPointerException("Null name");
      }
      this.name = name;
      return this;
    }
    @Override
    public Configuration.Builder color(String color) {
      if (color == null) {
        throw new NullPointerException("Null color");
      }
      this.color = color;
      return this;
    }
    @Override
    public Configuration.Builder template(String template) {
      if (template == null) {
        throw new NullPointerException("Null template");
      }
      this.template = template;
      return this;
    }
    @Override
    public Configuration build() {
      String missing = "";
      if (this.collectorId == null) {
        missing += " collectorId";
      }
      if (this.name == null) {
        missing += " name";
      }
      if (this.color == null) {
        missing += " color";
      }
      if (this.template == null) {
        missing += " template";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_Configuration(
          this.id,
          this.collectorId,
          this.name,
          this.color,
          this.template);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy