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

org.graylog2.rest.models.tools.responses.$AutoValue_RegexValidationResponse Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
package org.graylog2.rest.models.tools.responses;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Optional;
import javax.annotation.processing.Generated;

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

  private final String regex;

  private final boolean isValid;

  private final Optional validationMessage;

  $AutoValue_RegexValidationResponse(
      String regex,
      boolean isValid,
      Optional validationMessage) {
    if (regex == null) {
      throw new NullPointerException("Null regex");
    }
    this.regex = regex;
    this.isValid = isValid;
    if (validationMessage == null) {
      throw new NullPointerException("Null validationMessage");
    }
    this.validationMessage = validationMessage;
  }

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

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

  @JsonProperty("validation_message")
  @Override
  public Optional validationMessage() {
    return validationMessage;
  }

  @Override
  public String toString() {
    return "RegexValidationResponse{"
        + "regex=" + regex + ", "
        + "isValid=" + isValid + ", "
        + "validationMessage=" + validationMessage
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof RegexValidationResponse) {
      RegexValidationResponse that = (RegexValidationResponse) o;
      return this.regex.equals(that.regex())
          && this.isValid == that.isValid()
          && this.validationMessage.equals(that.validationMessage());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= regex.hashCode();
    h$ *= 1000003;
    h$ ^= isValid ? 1231 : 1237;
    h$ *= 1000003;
    h$ ^= validationMessage.hashCode();
    return h$;
  }

  static class Builder extends RegexValidationResponse.Builder {
    private String regex;
    private Boolean isValid;
    private Optional validationMessage = Optional.empty();
    Builder() {
    }
    @Override
    public RegexValidationResponse.Builder regex(String regex) {
      if (regex == null) {
        throw new NullPointerException("Null regex");
      }
      this.regex = regex;
      return this;
    }
    @Override
    public RegexValidationResponse.Builder isValid(boolean isValid) {
      this.isValid = isValid;
      return this;
    }
    @Override
    public RegexValidationResponse.Builder validationMessage(String validationMessage) {
      this.validationMessage = Optional.of(validationMessage);
      return this;
    }
    @Override
    public RegexValidationResponse build() {
      String missing = "";
      if (this.regex == null) {
        missing += " regex";
      }
      if (this.isValid == null) {
        missing += " isValid";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_RegexValidationResponse(
          this.regex,
          this.isValid,
          this.validationMessage);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy