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.1.4
Show newest version
package org.graylog.events.processor;

import com.fasterxml.jackson.annotation.JsonInclude;
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.context.EventDefinitionContextService;
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.joda.time.DateTime;
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;

  @Nullable
  private final String id;

  private final String title;

  private final String description;

  @Nullable
  private final String remediationSteps;

  @Nullable
  private final DateTime updatedAt;

  @Nullable
  private final DateTime matchedAt;

  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;

  @Nullable
  private final EventDefinitionContextService.SchedulerCtx schedulerCtx;

  private final EventDefinition.State state;

  $AutoValue_EventDefinitionDto(
      String scope,
      @Nullable String id,
      String title,
      String description,
      @Nullable String remediationSteps,
      @Nullable DateTime updatedAt,
      @Nullable DateTime matchedAt,
      int priority,
      boolean alert,
      EventProcessorConfig config,
      ImmutableMap fieldSpec,
      ImmutableList keySpec,
      EventNotificationSettings notificationSettings,
      ImmutableList notifications,
      ImmutableList storage,
      @Nullable EventDefinitionContextService.SchedulerCtx schedulerCtx,
      EventDefinition.State state) {
    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.remediationSteps = remediationSteps;
    this.updatedAt = updatedAt;
    this.matchedAt = matchedAt;
    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;
    this.schedulerCtx = schedulerCtx;
    if (state == null) {
      throw new NullPointerException("Null state");
    }
    this.state = state;
  }

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

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

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

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

  @JsonInclude(JsonInclude.Include.NON_NULL)
  @JsonProperty("remediation_steps")
  @Nullable
  @Override
  public String remediationSteps() {
    return remediationSteps;
  }

  @JsonProperty("updated_at")
  @Nullable
  @Override
  public DateTime updatedAt() {
    return updatedAt;
  }

  @JsonProperty("matched_at")
  @Nullable
  @Override
  public DateTime matchedAt() {
    return matchedAt;
  }

  @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;
  }

  @JsonProperty(value = "scheduler", access = JsonProperty.Access.READ_ONLY)
  @Nullable
  @Override
  public EventDefinitionContextService.SchedulerCtx schedulerCtx() {
    return schedulerCtx;
  }

  @JsonProperty("state")
  @Override
  public EventDefinition.State state() {
    return state;
  }

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

  @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.remediationSteps == null ? that.remediationSteps() == null : this.remediationSteps.equals(that.remediationSteps()))
          && (this.updatedAt == null ? that.updatedAt() == null : this.updatedAt.equals(that.updatedAt()))
          && (this.matchedAt == null ? that.matchedAt() == null : this.matchedAt.equals(that.matchedAt()))
          && 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())
          && (this.schedulerCtx == null ? that.schedulerCtx() == null : this.schedulerCtx.equals(that.schedulerCtx()))
          && this.state.equals(that.state());
    }
    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$ ^= (remediationSteps == null) ? 0 : remediationSteps.hashCode();
    h$ *= 1000003;
    h$ ^= (updatedAt == null) ? 0 : updatedAt.hashCode();
    h$ *= 1000003;
    h$ ^= (matchedAt == null) ? 0 : matchedAt.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();
    h$ *= 1000003;
    h$ ^= (schedulerCtx == null) ? 0 : schedulerCtx.hashCode();
    h$ *= 1000003;
    h$ ^= state.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 String remediationSteps;
    private DateTime updatedAt;
    private DateTime matchedAt;
    private int priority;
    private boolean alert;
    private EventProcessorConfig config;
    private ImmutableMap fieldSpec;
    private ImmutableList keySpec;
    private EventNotificationSettings notificationSettings;
    private ImmutableList notifications;
    private ImmutableList storage;
    private EventDefinitionContextService.SchedulerCtx schedulerCtx;
    private EventDefinition.State state;
    private byte set$0;
    Builder() {
    }
    private Builder(EventDefinitionDto source) {
      this.scope = source.scope();
      this.id = source.id();
      this.title = source.title();
      this.description = source.description();
      this.remediationSteps = source.remediationSteps();
      this.updatedAt = source.updatedAt();
      this.matchedAt = source.matchedAt();
      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();
      this.schedulerCtx = source.schedulerCtx();
      this.state = source.state();
      set$0 = (byte) 3;
    }
    @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 remediationSteps(String remediationSteps) {
      this.remediationSteps = remediationSteps;
      return this;
    }
    @Override
    public EventDefinitionDto.Builder updatedAt(DateTime updatedAt) {
      this.updatedAt = updatedAt;
      return this;
    }
    @Override
    public EventDefinitionDto.Builder matchedAt(DateTime matchedAt) {
      this.matchedAt = matchedAt;
      return this;
    }
    @Override
    public EventDefinitionDto.Builder priority(int priority) {
      this.priority = priority;
      set$0 |= (byte) 1;
      return this;
    }
    @Override
    public EventDefinitionDto.Builder alert(boolean alert) {
      this.alert = alert;
      set$0 |= (byte) 2;
      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
    public EventDefinitionDto.Builder schedulerCtx(EventDefinitionContextService.SchedulerCtx schedulerCtx) {
      this.schedulerCtx = schedulerCtx;
      return this;
    }
    @Override
    public EventDefinitionDto.Builder state(EventDefinition.State state) {
      if (state == null) {
        throw new NullPointerException("Null state");
      }
      this.state = state;
      return this;
    }
    @Override
    EventDefinitionDto autoBuild() {
      if (set$0 != 3
          || this.scope == null
          || this.title == null
          || this.description == null
          || this.config == null
          || this.fieldSpec == null
          || this.keySpec == null
          || this.notificationSettings == null
          || this.notifications == null
          || this.storage == null
          || this.state == null) {
        StringBuilder missing = new StringBuilder();
        if (this.scope == null) {
          missing.append(" scope");
        }
        if (this.title == null) {
          missing.append(" title");
        }
        if (this.description == null) {
          missing.append(" description");
        }
        if ((set$0 & 1) == 0) {
          missing.append(" priority");
        }
        if ((set$0 & 2) == 0) {
          missing.append(" alert");
        }
        if (this.config == null) {
          missing.append(" config");
        }
        if (this.fieldSpec == null) {
          missing.append(" fieldSpec");
        }
        if (this.keySpec == null) {
          missing.append(" keySpec");
        }
        if (this.notificationSettings == null) {
          missing.append(" notificationSettings");
        }
        if (this.notifications == null) {
          missing.append(" notifications");
        }
        if (this.storage == null) {
          missing.append(" storage");
        }
        if (this.state == null) {
          missing.append(" state");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_EventDefinitionDto(
          this.scope,
          this.id,
          this.title,
          this.description,
          this.remediationSteps,
          this.updatedAt,
          this.matchedAt,
          this.priority,
          this.alert,
          this.config,
          this.fieldSpec,
          this.keySpec,
          this.notificationSettings,
          this.notifications,
          this.storage,
          this.schedulerCtx,
          this.state);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy