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

org.graylog2.indexer.fieldtypes.AutoValue_IndexFieldTypesDTO Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
package org.graylog2.indexer.fieldtypes;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableSet;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import org.mongojack.Id;
import org.mongojack.ObjectId;

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

  private final String id;

  private final String indexSetId;

  private final String indexName;

  private final ImmutableSet fields;

  private AutoValue_IndexFieldTypesDTO(
      @Nullable String id,
      String indexSetId,
      String indexName,
      ImmutableSet fields) {
    this.id = id;
    this.indexSetId = indexSetId;
    this.indexName = indexName;
    this.fields = fields;
  }

  @Id
  @ObjectId
  @Nullable
  @JsonProperty("id")
  @Override
  public String id() {
    return id;
  }

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

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

  @JsonProperty("fields")
  @Override
  public ImmutableSet fields() {
    return fields;
  }

  @Override
  public String toString() {
    return "IndexFieldTypesDTO{"
        + "id=" + id + ", "
        + "indexSetId=" + indexSetId + ", "
        + "indexName=" + indexName + ", "
        + "fields=" + fields
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof IndexFieldTypesDTO) {
      IndexFieldTypesDTO that = (IndexFieldTypesDTO) o;
      return (this.id == null ? that.id() == null : this.id.equals(that.id()))
          && this.indexSetId.equals(that.indexSetId())
          && this.indexName.equals(that.indexName())
          && this.fields.equals(that.fields());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= (id == null) ? 0 : id.hashCode();
    h$ *= 1000003;
    h$ ^= indexSetId.hashCode();
    h$ *= 1000003;
    h$ ^= indexName.hashCode();
    h$ *= 1000003;
    h$ ^= fields.hashCode();
    return h$;
  }

  @Override
  public IndexFieldTypesDTO.Builder toBuilder() {
    return new Builder(this);
  }

  static final class Builder extends IndexFieldTypesDTO.Builder {
    private String id;
    private String indexSetId;
    private String indexName;
    private ImmutableSet.Builder fieldsBuilder$;
    private ImmutableSet fields;
    Builder() {
    }
    private Builder(IndexFieldTypesDTO source) {
      this.id = source.id();
      this.indexSetId = source.indexSetId();
      this.indexName = source.indexName();
      this.fields = source.fields();
    }
    @Override
    public IndexFieldTypesDTO.Builder id(String id) {
      this.id = id;
      return this;
    }
    @Override
    public IndexFieldTypesDTO.Builder indexSetId(String indexSetId) {
      if (indexSetId == null) {
        throw new NullPointerException("Null indexSetId");
      }
      this.indexSetId = indexSetId;
      return this;
    }
    @Override
    public IndexFieldTypesDTO.Builder indexName(String indexName) {
      if (indexName == null) {
        throw new NullPointerException("Null indexName");
      }
      this.indexName = indexName;
      return this;
    }
    @Override
    ImmutableSet.Builder fieldsBuilder() {
      if (fieldsBuilder$ == null) {
        if (fields == null) {
          fieldsBuilder$ = ImmutableSet.builder();
        } else {
          fieldsBuilder$ = ImmutableSet.builder();
          fieldsBuilder$.addAll(fields);
          fields = null;
        }
      }
      return fieldsBuilder$;
    }
    @Override
    public IndexFieldTypesDTO build() {
      if (fieldsBuilder$ != null) {
        this.fields = fieldsBuilder$.build();
      } else if (this.fields == null) {
        this.fields = ImmutableSet.of();
      }
      String missing = "";
      if (this.indexSetId == null) {
        missing += " indexSetId";
      }
      if (this.indexName == null) {
        missing += " indexName";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_IndexFieldTypesDTO(
          this.id,
          this.indexSetId,
          this.indexName,
          this.fields);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy