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

org.graylog2.rest.models.system.indexer.responses.$AutoValue_ShardRouting Maven / Gradle / Ivy

There is a newer version: 5.2.7
Show newest version

package org.graylog2.rest.models.system.indexer.responses;

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

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

  private final int id;
  private final String state;
  private final boolean active;
  private final boolean primary;
  private final String nodeId;
  private final String nodeName;
  private final String nodeHostname;
  private final String relocatingTo;

  $AutoValue_ShardRouting(
      int id,
      String state,
      boolean active,
      boolean primary,
      String nodeId,
      @Nullable String nodeName,
      @Nullable String nodeHostname,
      @Nullable String relocatingTo) {
    this.id = id;
    if (state == null) {
      throw new NullPointerException("Null state");
    }
    this.state = state;
    this.active = active;
    this.primary = primary;
    if (nodeId == null) {
      throw new NullPointerException("Null nodeId");
    }
    this.nodeId = nodeId;
    this.nodeName = nodeName;
    this.nodeHostname = nodeHostname;
    this.relocatingTo = relocatingTo;
  }

  @JsonProperty(value = "id")
  @Override
  public int id() {
    return id;
  }

  @JsonProperty(value = "state")
  @Override
  public String state() {
    return state;
  }

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

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

  @JsonProperty(value = "node_id")
  @Override
  public String nodeId() {
    return nodeId;
  }

  @JsonProperty(value = "node_name")
  @Nullable
  @Override
  public String nodeName() {
    return nodeName;
  }

  @JsonProperty(value = "node_hostname")
  @Nullable
  @Override
  public String nodeHostname() {
    return nodeHostname;
  }

  @JsonProperty(value = "relocating_to")
  @Nullable
  @Override
  public String relocatingTo() {
    return relocatingTo;
  }

  @Override
  public String toString() {
    return "ShardRouting{"
        + "id=" + id + ", "
        + "state=" + state + ", "
        + "active=" + active + ", "
        + "primary=" + primary + ", "
        + "nodeId=" + nodeId + ", "
        + "nodeName=" + nodeName + ", "
        + "nodeHostname=" + nodeHostname + ", "
        + "relocatingTo=" + relocatingTo
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof ShardRouting) {
      ShardRouting that = (ShardRouting) o;
      return (this.id == that.id())
           && (this.state.equals(that.state()))
           && (this.active == that.active())
           && (this.primary == that.primary())
           && (this.nodeId.equals(that.nodeId()))
           && ((this.nodeName == null) ? (that.nodeName() == null) : this.nodeName.equals(that.nodeName()))
           && ((this.nodeHostname == null) ? (that.nodeHostname() == null) : this.nodeHostname.equals(that.nodeHostname()))
           && ((this.relocatingTo == null) ? (that.relocatingTo() == null) : this.relocatingTo.equals(that.relocatingTo()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h = 1;
    h *= 1000003;
    h ^= this.id;
    h *= 1000003;
    h ^= this.state.hashCode();
    h *= 1000003;
    h ^= this.active ? 1231 : 1237;
    h *= 1000003;
    h ^= this.primary ? 1231 : 1237;
    h *= 1000003;
    h ^= this.nodeId.hashCode();
    h *= 1000003;
    h ^= (nodeName == null) ? 0 : this.nodeName.hashCode();
    h *= 1000003;
    h ^= (nodeHostname == null) ? 0 : this.nodeHostname.hashCode();
    h *= 1000003;
    h ^= (relocatingTo == null) ? 0 : this.relocatingTo.hashCode();
    return h;
  }

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

  static final class Builder extends ShardRouting.Builder {
    private Integer id;
    private String state;
    private Boolean active;
    private Boolean primary;
    private String nodeId;
    private String nodeName;
    private String nodeHostname;
    private String relocatingTo;
    Builder() {
    }
    private Builder(ShardRouting source) {
      this.id = source.id();
      this.state = source.state();
      this.active = source.active();
      this.primary = source.primary();
      this.nodeId = source.nodeId();
      this.nodeName = source.nodeName();
      this.nodeHostname = source.nodeHostname();
      this.relocatingTo = source.relocatingTo();
    }
    @Override
    public ShardRouting.Builder id(int id) {
      this.id = id;
      return this;
    }
    @Override
    public ShardRouting.Builder state(String state) {
      if (state == null) {
        throw new NullPointerException("Null state");
      }
      this.state = state;
      return this;
    }
    @Override
    public ShardRouting.Builder active(boolean active) {
      this.active = active;
      return this;
    }
    @Override
    public ShardRouting.Builder primary(boolean primary) {
      this.primary = primary;
      return this;
    }
    @Override
    public ShardRouting.Builder nodeId(String nodeId) {
      if (nodeId == null) {
        throw new NullPointerException("Null nodeId");
      }
      this.nodeId = nodeId;
      return this;
    }
    @Override
    public ShardRouting.Builder nodeName(@Nullable String nodeName) {
      this.nodeName = nodeName;
      return this;
    }
    @Override
    public ShardRouting.Builder nodeHostname(@Nullable String nodeHostname) {
      this.nodeHostname = nodeHostname;
      return this;
    }
    @Override
    public ShardRouting.Builder relocatingTo(@Nullable String relocatingTo) {
      this.relocatingTo = relocatingTo;
      return this;
    }
    @Override
    ShardRouting build() {
      String missing = "";
      if (this.id == null) {
        missing += " id";
      }
      if (this.state == null) {
        missing += " state";
      }
      if (this.active == null) {
        missing += " active";
      }
      if (this.primary == null) {
        missing += " primary";
      }
      if (this.nodeId == null) {
        missing += " nodeId";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_ShardRouting(
          this.id,
          this.state,
          this.active,
          this.primary,
          this.nodeId,
          this.nodeName,
          this.nodeHostname,
          this.relocatingTo);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy