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

org.graylog2.indexer.fieldtypes.AutoValue_FieldTypeDTO 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 java.util.Set;
import javax.annotation.processing.Generated;

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

  private final String fieldName;

  private final String physicalType;

  private final Set properties;

  private final Set streams;

  private AutoValue_FieldTypeDTO(
      String fieldName,
      String physicalType,
      Set properties,
      Set streams) {
    this.fieldName = fieldName;
    this.physicalType = physicalType;
    this.properties = properties;
    this.streams = streams;
  }

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

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

  @JsonProperty("properties")
  @Override
  public Set properties() {
    return properties;
  }

  @JsonProperty("streams")
  @Override
  public Set streams() {
    return streams;
  }

  @Override
  public String toString() {
    return "FieldTypeDTO{"
        + "fieldName=" + fieldName + ", "
        + "physicalType=" + physicalType + ", "
        + "properties=" + properties + ", "
        + "streams=" + streams
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof FieldTypeDTO) {
      FieldTypeDTO that = (FieldTypeDTO) o;
      return this.fieldName.equals(that.fieldName())
          && this.physicalType.equals(that.physicalType())
          && this.properties.equals(that.properties())
          && this.streams.equals(that.streams());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= fieldName.hashCode();
    h$ *= 1000003;
    h$ ^= physicalType.hashCode();
    h$ *= 1000003;
    h$ ^= properties.hashCode();
    h$ *= 1000003;
    h$ ^= streams.hashCode();
    return h$;
  }

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

  static final class Builder extends FieldTypeDTO.Builder {
    private String fieldName;
    private String physicalType;
    private Set properties;
    private Set streams;
    Builder() {
    }
    private Builder(FieldTypeDTO source) {
      this.fieldName = source.fieldName();
      this.physicalType = source.physicalType();
      this.properties = source.properties();
      this.streams = source.streams();
    }
    @Override
    public FieldTypeDTO.Builder fieldName(String fieldName) {
      if (fieldName == null) {
        throw new NullPointerException("Null fieldName");
      }
      this.fieldName = fieldName;
      return this;
    }
    @Override
    public FieldTypeDTO.Builder physicalType(String physicalType) {
      if (physicalType == null) {
        throw new NullPointerException("Null physicalType");
      }
      this.physicalType = physicalType;
      return this;
    }
    @Override
    public FieldTypeDTO.Builder properties(Set properties) {
      if (properties == null) {
        throw new NullPointerException("Null properties");
      }
      this.properties = properties;
      return this;
    }
    @Override
    public FieldTypeDTO.Builder streams(Set streams) {
      if (streams == null) {
        throw new NullPointerException("Null streams");
      }
      this.streams = streams;
      return this;
    }
    @Override
    public FieldTypeDTO build() {
      String missing = "";
      if (this.fieldName == null) {
        missing += " fieldName";
      }
      if (this.physicalType == null) {
        missing += " physicalType";
      }
      if (this.properties == null) {
        missing += " properties";
      }
      if (this.streams == null) {
        missing += " streams";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_FieldTypeDTO(
          this.fieldName,
          this.physicalType,
          this.properties,
          this.streams);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy