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

org.graylog2.contentpacks.model.entities.AutoValue_EntityDescriptor Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
package org.graylog2.contentpacks.model.entities;

import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Generated;
import org.graylog2.contentpacks.model.ModelId;
import org.graylog2.contentpacks.model.ModelType;

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

  private final ModelId id;

  private final ModelType type;

  private AutoValue_EntityDescriptor(
      ModelId id,
      ModelType type) {
    this.id = id;
    this.type = type;
  }

  @JsonProperty("id")
  @Override
  public ModelId id() {
    return id;
  }

  @JsonProperty("type")
  @Override
  public ModelType type() {
    return type;
  }

  @Override
  public String toString() {
    return "EntityDescriptor{"
        + "id=" + id + ", "
        + "type=" + type
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof EntityDescriptor) {
      EntityDescriptor that = (EntityDescriptor) o;
      return this.id.equals(that.id())
          && this.type.equals(that.type());
    }
    return false;
  }

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

  static final class Builder implements EntityDescriptor.Builder {
    private ModelId id;
    private ModelType type;
    Builder() {
    }
    @Override
    public EntityDescriptor.Builder id(ModelId id) {
      if (id == null) {
        throw new NullPointerException("Null id");
      }
      this.id = id;
      return this;
    }
    @Override
    public ModelId id() {
      if (id == null) {
        throw new IllegalStateException("Property \"id\" has not been set");
      }
      return id;
    }
    @Override
    public EntityDescriptor.Builder type(ModelType type) {
      if (type == null) {
        throw new NullPointerException("Null type");
      }
      this.type = type;
      return this;
    }
    @Override
    public EntityDescriptor build() {
      String missing = "";
      if (this.id == null) {
        missing += " id";
      }
      if (this.type == null) {
        missing += " type";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_EntityDescriptor(
          this.id,
          this.type);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy