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

org.graylog.plugins.views.search.validation.AutoValue_ValidationMessage Maven / Gradle / Ivy

package org.graylog.plugins.views.search.validation;

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

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

  private final Integer beginLine;

  private final Integer beginColumn;

  private final Integer endLine;

  private final Integer endColumn;

  private final String errorMessage;

  private final String relatedProperty;

  private final ValidationType validationType;

  private AutoValue_ValidationMessage(
      @Nullable Integer beginLine,
      @Nullable Integer beginColumn,
      @Nullable Integer endLine,
      @Nullable Integer endColumn,
      String errorMessage,
      @Nullable String relatedProperty,
      ValidationType validationType) {
    this.beginLine = beginLine;
    this.beginColumn = beginColumn;
    this.endLine = endLine;
    this.endColumn = endColumn;
    this.errorMessage = errorMessage;
    this.relatedProperty = relatedProperty;
    this.validationType = validationType;
  }

  @JsonProperty
  @Nullable
  @Override
  public Integer beginLine() {
    return beginLine;
  }

  @JsonProperty
  @Nullable
  @Override
  public Integer beginColumn() {
    return beginColumn;
  }

  @JsonProperty
  @Nullable
  @Override
  public Integer endLine() {
    return endLine;
  }

  @JsonProperty
  @Nullable
  @Override
  public Integer endColumn() {
    return endColumn;
  }

  @JsonProperty
  @Override
  public String errorMessage() {
    return errorMessage;
  }

  @Nullable
  @JsonProperty
  @Override
  public String relatedProperty() {
    return relatedProperty;
  }

  @JsonProperty
  @Override
  public ValidationType validationType() {
    return validationType;
  }

  @Override
  public String toString() {
    return "ValidationMessage{"
        + "beginLine=" + beginLine + ", "
        + "beginColumn=" + beginColumn + ", "
        + "endLine=" + endLine + ", "
        + "endColumn=" + endColumn + ", "
        + "errorMessage=" + errorMessage + ", "
        + "relatedProperty=" + relatedProperty + ", "
        + "validationType=" + validationType
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof ValidationMessage) {
      ValidationMessage that = (ValidationMessage) o;
      return (this.beginLine == null ? that.beginLine() == null : this.beginLine.equals(that.beginLine()))
          && (this.beginColumn == null ? that.beginColumn() == null : this.beginColumn.equals(that.beginColumn()))
          && (this.endLine == null ? that.endLine() == null : this.endLine.equals(that.endLine()))
          && (this.endColumn == null ? that.endColumn() == null : this.endColumn.equals(that.endColumn()))
          && this.errorMessage.equals(that.errorMessage())
          && (this.relatedProperty == null ? that.relatedProperty() == null : this.relatedProperty.equals(that.relatedProperty()))
          && this.validationType.equals(that.validationType());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= (beginLine == null) ? 0 : beginLine.hashCode();
    h$ *= 1000003;
    h$ ^= (beginColumn == null) ? 0 : beginColumn.hashCode();
    h$ *= 1000003;
    h$ ^= (endLine == null) ? 0 : endLine.hashCode();
    h$ *= 1000003;
    h$ ^= (endColumn == null) ? 0 : endColumn.hashCode();
    h$ *= 1000003;
    h$ ^= errorMessage.hashCode();
    h$ *= 1000003;
    h$ ^= (relatedProperty == null) ? 0 : relatedProperty.hashCode();
    h$ *= 1000003;
    h$ ^= validationType.hashCode();
    return h$;
  }

  static final class Builder extends ValidationMessage.Builder {
    private Integer beginLine;
    private Integer beginColumn;
    private Integer endLine;
    private Integer endColumn;
    private String errorMessage;
    private String relatedProperty;
    private ValidationType validationType;
    Builder() {
    }
    @Override
    public ValidationMessage.Builder beginLine(int beginLine) {
      this.beginLine = beginLine;
      return this;
    }
    @Override
    public ValidationMessage.Builder beginColumn(int beginColumn) {
      this.beginColumn = beginColumn;
      return this;
    }
    @Override
    public ValidationMessage.Builder endLine(int endLine) {
      this.endLine = endLine;
      return this;
    }
    @Override
    public ValidationMessage.Builder endColumn(int endColumn) {
      this.endColumn = endColumn;
      return this;
    }
    @Override
    public ValidationMessage.Builder errorMessage(String errorMessage) {
      if (errorMessage == null) {
        throw new NullPointerException("Null errorMessage");
      }
      this.errorMessage = errorMessage;
      return this;
    }
    @Override
    public ValidationMessage.Builder relatedProperty(String relatedProperty) {
      this.relatedProperty = relatedProperty;
      return this;
    }
    @Override
    public ValidationMessage.Builder validationType(ValidationType validationType) {
      if (validationType == null) {
        throw new NullPointerException("Null validationType");
      }
      this.validationType = validationType;
      return this;
    }
    @Override
    public ValidationMessage build() {
      String missing = "";
      if (this.errorMessage == null) {
        missing += " errorMessage";
      }
      if (this.validationType == null) {
        missing += " validationType";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_ValidationMessage(
          this.beginLine,
          this.beginColumn,
          this.endLine,
          this.endColumn,
          this.errorMessage,
          this.relatedProperty,
          this.validationType);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy