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

org.graylog.events.processor.$AutoValue_EventDefinitionDto Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
package org.graylog.events.processor;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;
import org.graylog.events.fields.EventFieldSpec;
import org.graylog.events.notifications.EventNotificationHandler;
import org.graylog.events.notifications.EventNotificationSettings;
import org.graylog.events.processor.storage.EventStorageHandler;
import org.mongojack.Id;
import org.mongojack.ObjectId;

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

  private final String scope;

  private final String id;

  private final String title;

  private final String description;

  private final int priority;

  private final boolean alert;

  private final EventProcessorConfig config;

  private final ImmutableMap fieldSpec;

  private final ImmutableList keySpec;

  private final EventNotificationSettings notificationSettings;

  private final ImmutableList notifications;

  private final ImmutableList storage;

  $AutoValue_EventDefinitionDto(
      String scope,
      @Nullable String id,
      String title,
      String description,
      int priority,
      boolean alert,
      EventProcessorConfig config,
      ImmutableMap fieldSpec,
      ImmutableList keySpec,
      EventNotificationSettings notificationSettings,
      ImmutableList notifications,
      ImmutableList storage) {
    if (scope == null) {
      throw new NullPointerException("Null scope");
    }
    this.scope = scope;
    this.id = id;
    if (title == null) {
      throw new NullPointerException("Null title");
    }
    this.title = title;
    if (description == null) {
      throw new NullPointerException("Null description");
    }
    this.description = description;
    this.priority = priority;
    this.alert = alert;
    if (config == null) {
      throw new NullPointerException("Null config");
    }
    this.config = config;
    if (fieldSpec == null) {
      throw new NullPointerException("Null fieldSpec");
    }
    this.fieldSpec = fieldSpec;
    if (keySpec == null) {
      throw new NullPointerException("Null keySpec");
    }
    this.keySpec = keySpec;
    if (notificationSettings == null) {
      throw new NullPointerException("Null notificationSettings");
    }
    this.notificationSettings = notificationSettings;
    if (notifications == null) {
      throw new NullPointerException("Null notifications");
    }
    this.notifications = notifications;
    if (storage == null) {
      throw new NullPointerException("Null storage");
    }
    this.storage = storage;
  }

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

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

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

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

  @JsonProperty("priority")
  @Override
  public int priority() {
    return priority;
  }

  @JsonProperty("alert")
  @Override
  public boolean alert() {
    return alert;
  }

  @JsonProperty("config")
  @Override
  public EventProcessorConfig config() {
    return config;
  }

  @JsonProperty("field_spec")
  @Override
  public ImmutableMap fieldSpec() {
    return fieldSpec;
  }

  @JsonProperty("key_spec")
  @Override
  public ImmutableList keySpec() {
    return keySpec;
  }

  @JsonProperty("notification_settings")
  @Override
  public EventNotificationSettings notificationSettings() {
    return notificationSettings;
  }

  @JsonProperty("notifications")
  @Override
  public ImmutableList notifications() {
    return notifications;
  }

  @JsonProperty("storage")
  @Override
  public ImmutableList storage() {
    return storage;
  }

  @Override
  public String toString() {
    return "EventDefinitionDto{"
        + "scope=" + scope + ", "
        + "id=" + id + ", "
        + "title=" + title + ", "
        + "description=" + description + ", "
        + "priority=" + priority + ", "
        + "alert=" + alert + ", "
        + "config=" + config + ", "
        + "fieldSpec=" + fieldSpec + ", "
        + "keySpec=" + keySpec + ", "
        + "notificationSettings=" + notificationSettings + ", "
        + "notifications=" + notifications + ", "
        + "storage=" + storage
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof EventDefinitionDto) {
      EventDefinitionDto that = (EventDefinitionDto) o;
      return this.scope.equals(that.scope())
          && (this.id == null ? that.id() == null : this.id.equals(that.id()))
          && this.title.equals(that.title())
          && this.description.equals(that.description())
          && this.priority == that.priority()
          && this.alert == that.alert()
          && this.config.equals(that.config())
          && this.fieldSpec.equals(that.fieldSpec())
          && this.keySpec.equals(that.keySpec())
          && this.notificationSettings.equals(that.notificationSettings())
          && this.notifications.equals(that.notifications())
          && this.storage.equals(that.storage());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= scope.hashCode();
    h$ *= 1000003;
    h$ ^= (id == null) ? 0 : id.hashCode();
    h$ *= 1000003;
    h$ ^= title.hashCode();
    h$ *= 1000003;
    h$ ^= description.hashCode();
    h$ *= 1000003;
    h$ ^= priority;
    h$ *= 1000003;
    h$ ^= alert ? 1231 : 1237;
    h$ *= 1000003;
    h$ ^= config.hashCode();
    h$ *= 1000003;
    h$ ^= fieldSpec.hashCode();
    h$ *= 1000003;
    h$ ^= keySpec.hashCode();
    h$ *= 1000003;
    h$ ^= notificationSettings.hashCode();
    h$ *= 1000003;
    h$ ^= notifications.hashCode();
    h$ *= 1000003;
    h$ ^= storage.hashCode();
    return h$;
  }

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

  static class Builder extends EventDefinitionDto.Builder {
    private String scope;
    private String id;
    private String title;
    private String description;
    private Integer priority;
    private Boolean alert;
    private EventProcessorConfig config;
    private ImmutableMap fieldSpec;
    private ImmutableList keySpec;
    private EventNotificationSettings notificationSettings;
    private ImmutableList notifications;
    private ImmutableList storage;
    Builder() {
    }
    private Builder(EventDefinitionDto source) {
      this.scope = source.scope();
      this.id = source.id();
      this.title = source.title();
      this.description = source.description();
      this.priority = source.priority();
      this.alert = source.alert();
      this.config = source.config();
      this.fieldSpec = source.fieldSpec();
      this.keySpec = source.keySpec();
      this.notificationSettings = source.notificationSettings();
      this.notifications = source.notifications();
      this.storage = source.storage();
    }
    @Override
    public EventDefinitionDto.Builder scope(String scope) {
      if (scope == null) {
        throw new NullPointerException("Null scope");
      }
      this.scope = scope;
      return this;
    }
    @Override
    public EventDefinitionDto.Builder id(String id) {
      this.id = id;
      return this;
    }
    @Override
    public EventDefinitionDto.Builder title(String title) {
      if (title == null) {
        throw new NullPointerException("Null title");
      }
      this.title = title;
      return this;
    }
    @Override
    public EventDefinitionDto.Builder description(String description) {
      if (description == null) {
        throw new NullPointerException("Null description");
      }
      this.description = description;
      return this;
    }
    @Override
    public EventDefinitionDto.Builder priority(int priority) {
      this.priority = priority;
      return this;
    }
    @Override
    public EventDefinitionDto.Builder alert(boolean alert) {
      this.alert = alert;
      return this;
    }
    @Override
    public EventDefinitionDto.Builder config(EventProcessorConfig config) {
      if (config == null) {
        throw new NullPointerException("Null config");
      }
      this.config = config;
      return this;
    }
    @Override
    public EventDefinitionDto.Builder fieldSpec(ImmutableMap fieldSpec) {
      if (fieldSpec == null) {
        throw new NullPointerException("Null fieldSpec");
      }
      this.fieldSpec = fieldSpec;
      return this;
    }
    @Override
    public EventDefinitionDto.Builder keySpec(ImmutableList keySpec) {
      if (keySpec == null) {
        throw new NullPointerException("Null keySpec");
      }
      this.keySpec = keySpec;
      return this;
    }
    @Override
    public EventDefinitionDto.Builder notificationSettings(EventNotificationSettings notificationSettings) {
      if (notificationSettings == null) {
        throw new NullPointerException("Null notificationSettings");
      }
      this.notificationSettings = notificationSettings;
      return this;
    }
    @Override
    public EventDefinitionDto.Builder notifications(ImmutableList notifications) {
      if (notifications == null) {
        throw new NullPointerException("Null notifications");
      }
      this.notifications = notifications;
      return this;
    }
    @Override
    public EventDefinitionDto.Builder storage(ImmutableList storage) {
      if (storage == null) {
        throw new NullPointerException("Null storage");
      }
      this.storage = storage;
      return this;
    }
    @Override
    EventDefinitionDto autoBuild() {
      String missing = "";
      if (this.scope == null) {
        missing += " scope";
      }
      if (this.title == null) {
        missing += " title";
      }
      if (this.description == null) {
        missing += " description";
      }
      if (this.priority == null) {
        missing += " priority";
      }
      if (this.alert == null) {
        missing += " alert";
      }
      if (this.config == null) {
        missing += " config";
      }
      if (this.fieldSpec == null) {
        missing += " fieldSpec";
      }
      if (this.keySpec == null) {
        missing += " keySpec";
      }
      if (this.notificationSettings == null) {
        missing += " notificationSettings";
      }
      if (this.notifications == null) {
        missing += " notifications";
      }
      if (this.storage == null) {
        missing += " storage";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_EventDefinitionDto(
          this.scope,
          this.id,
          this.title,
          this.description,
          this.priority,
          this.alert,
          this.config,
          this.fieldSpec,
          this.keySpec,
          this.notificationSettings,
          this.notifications,
          this.storage);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy