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

org.graylog.grn.AutoValue_GRNDescriptor Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
package org.graylog.grn;

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

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

  private final GRN grn;

  private final String title;

  private AutoValue_GRNDescriptor(
      GRN grn,
      String title) {
    this.grn = grn;
    this.title = title;
  }

  @JsonProperty("grn")
  @Override
  public GRN grn() {
    return grn;
  }

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

  @Override
  public String toString() {
    return "GRNDescriptor{"
        + "grn=" + grn + ", "
        + "title=" + title
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof GRNDescriptor) {
      GRNDescriptor that = (GRNDescriptor) o;
      return this.grn.equals(that.grn())
          && this.title.equals(that.title());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= grn.hashCode();
    h$ *= 1000003;
    h$ ^= title.hashCode();
    return h$;
  }

  static final class Builder extends GRNDescriptor.Builder {
    private GRN grn;
    private String title;
    Builder() {
    }
    @Override
    public GRNDescriptor.Builder grn(GRN grn) {
      if (grn == null) {
        throw new NullPointerException("Null grn");
      }
      this.grn = grn;
      return this;
    }
    @Override
    public GRNDescriptor.Builder title(String title) {
      if (title == null) {
        throw new NullPointerException("Null title");
      }
      this.title = title;
      return this;
    }
    @Override
    public GRNDescriptor build() {
      if (this.grn == null
          || this.title == null) {
        StringBuilder missing = new StringBuilder();
        if (this.grn == null) {
          missing.append(" grn");
        }
        if (this.title == null) {
          missing.append(" title");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_GRNDescriptor(
          this.grn,
          this.title);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy