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

org.graylog2.rest.models.tools.requests.$AutoValue_RegexReplaceTestRequest Maven / Gradle / Ivy

There is a newer version: 5.2.7
Show newest version


package org.graylog2.rest.models.tools.requests;

import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Generated;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

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

  private final @NotNull String string;

  private final @NotEmpty String regex;

  private final @NotNull String replacement;

  private final boolean replaceAll;

  $AutoValue_RegexReplaceTestRequest(
      @NotNull String string,
      @NotEmpty String regex,
      @NotNull String replacement,
      boolean replaceAll) {
    if (string == null) {
      throw new NullPointerException("Null string");
    }
    this.string = string;
    if (regex == null) {
      throw new NullPointerException("Null regex");
    }
    this.regex = regex;
    if (replacement == null) {
      throw new NullPointerException("Null replacement");
    }
    this.replacement = replacement;
    this.replaceAll = replaceAll;
  }

  @JsonProperty
  @Override
  public @NotNull String string() {
    return string;
  }

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

  @JsonProperty
  @Override
  public @NotNull String replacement() {
    return replacement;
  }

  @JsonProperty(value = "replace_all")
  @Override
  public boolean replaceAll() {
    return replaceAll;
  }

  @Override
  public String toString() {
    return "RegexReplaceTestRequest{"
         + "string=" + string + ", "
         + "regex=" + regex + ", "
         + "replacement=" + replacement + ", "
         + "replaceAll=" + replaceAll
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof RegexReplaceTestRequest) {
      RegexReplaceTestRequest that = (RegexReplaceTestRequest) o;
      return (this.string.equals(that.string()))
           && (this.regex.equals(that.regex()))
           && (this.replacement.equals(that.replacement()))
           && (this.replaceAll == that.replaceAll());
    }
    return false;
  }

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy