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

org.graylog.plugins.pipelineprocessor.rest.AutoValue_StageSource Maven / Gradle / Ivy

There is a newer version: 5.2.7
Show newest version
package org.graylog.plugins.pipelineprocessor.rest;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import javax.annotation.Generated;
import javax.validation.constraints.Min;

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

  private final @Min(0L) int stage;

  private final boolean matchAll;

  private final List rules;

  private AutoValue_StageSource(
      @Min(0L) int stage,
      boolean matchAll,
      List rules) {
    this.stage = stage;
    this.matchAll = matchAll;
    this.rules = rules;
  }

  @JsonProperty("stage")
  @Override
  public @Min(0L) int stage() {
    return stage;
  }

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

  @JsonProperty("rules")
  @Override
  public List rules() {
    return rules;
  }

  @Override
  public String toString() {
    return "StageSource{"
         + "stage=" + stage + ", "
         + "matchAll=" + matchAll + ", "
         + "rules=" + rules
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof StageSource) {
      StageSource that = (StageSource) o;
      return this.stage == that.stage()
          && this.matchAll == that.matchAll()
          && this.rules.equals(that.rules());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= stage;
    h$ *= 1000003;
    h$ ^= matchAll ? 1231 : 1237;
    h$ *= 1000003;
    h$ ^= rules.hashCode();
    return h$;
  }

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

  static final class Builder extends StageSource.Builder {
    private Integer stage;
    private Boolean matchAll;
    private List rules;
    Builder() {
    }
    private Builder(StageSource source) {
      this.stage = source.stage();
      this.matchAll = source.matchAll();
      this.rules = source.rules();
    }
    @Override
    public StageSource.Builder stage(int stage) {
      this.stage = stage;
      return this;
    }
    @Override
    public StageSource.Builder matchAll(boolean matchAll) {
      this.matchAll = matchAll;
      return this;
    }
    @Override
    public StageSource.Builder rules(List rules) {
      if (rules == null) {
        throw new NullPointerException("Null rules");
      }
      this.rules = rules;
      return this;
    }
    @Override
    public StageSource build() {
      String missing = "";
      if (this.stage == null) {
        missing += " stage";
      }
      if (this.matchAll == null) {
        missing += " matchAll";
      }
      if (this.rules == null) {
        missing += " rules";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_StageSource(
          this.stage,
          this.matchAll,
          this.rules);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy