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

org.graylog.plugins.views.search.views.formatting.highlighting.$AutoValue_HighlightingRule Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
package org.graylog.plugins.views.search.views.formatting.highlighting;

import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Generated;

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

  private final String field;

  private final String value;

  private final HighlightingColor color;

  private final Condition condition;

  $AutoValue_HighlightingRule(
      String field,
      String value,
      HighlightingColor color,
      Condition condition) {
    if (field == null) {
      throw new NullPointerException("Null field");
    }
    this.field = field;
    if (value == null) {
      throw new NullPointerException("Null value");
    }
    this.value = value;
    if (color == null) {
      throw new NullPointerException("Null color");
    }
    this.color = color;
    if (condition == null) {
      throw new NullPointerException("Null condition");
    }
    this.condition = condition;
  }

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

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

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

  @JsonProperty("condition")
  @Override
  public Condition condition() {
    return condition;
  }

  @Override
  public String toString() {
    return "HighlightingRule{"
        + "field=" + field + ", "
        + "value=" + value + ", "
        + "color=" + color + ", "
        + "condition=" + condition
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof HighlightingRule) {
      HighlightingRule that = (HighlightingRule) o;
      return this.field.equals(that.field())
          && this.value.equals(that.value())
          && this.color.equals(that.color())
          && this.condition.equals(that.condition());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= field.hashCode();
    h$ *= 1000003;
    h$ ^= value.hashCode();
    h$ *= 1000003;
    h$ ^= color.hashCode();
    h$ *= 1000003;
    h$ ^= condition.hashCode();
    return h$;
  }

  static class Builder extends HighlightingRule.Builder {
    private String field;
    private String value;
    private HighlightingColor color;
    private Condition condition;
    Builder() {
    }
    @Override
    public HighlightingRule.Builder field(String field) {
      if (field == null) {
        throw new NullPointerException("Null field");
      }
      this.field = field;
      return this;
    }
    @Override
    public HighlightingRule.Builder value(String value) {
      if (value == null) {
        throw new NullPointerException("Null value");
      }
      this.value = value;
      return this;
    }
    @Override
    public HighlightingRule.Builder color(HighlightingColor color) {
      if (color == null) {
        throw new NullPointerException("Null color");
      }
      this.color = color;
      return this;
    }
    @Override
    public HighlightingRule.Builder condition(Condition condition) {
      if (condition == null) {
        throw new NullPointerException("Null condition");
      }
      this.condition = condition;
      return this;
    }
    @Override
    public HighlightingRule build() {
      String missing = "";
      if (this.field == null) {
        missing += " field";
      }
      if (this.value == null) {
        missing += " value";
      }
      if (this.color == null) {
        missing += " color";
      }
      if (this.condition == null) {
        missing += " condition";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_HighlightingRule(
          this.field,
          this.value,
          this.color,
          this.condition);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy