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

ai.grakn.engine.tasks.manager.redisqueue.AutoValue_Task Maven / Gradle / Ivy

There is a newer version: 1.4.3
Show newest version

package ai.grakn.engine.tasks.manager.redisqueue;

import ai.grakn.engine.tasks.manager.TaskConfiguration;
import ai.grakn.engine.tasks.manager.TaskState;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Generated;

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

  private final TaskState taskState;
  private final TaskConfiguration taskConfiguration;

  private AutoValue_Task(
      TaskState taskState,
      TaskConfiguration taskConfiguration) {
    this.taskState = taskState;
    this.taskConfiguration = taskConfiguration;
  }

  @JsonProperty(value = "taskState")
  @Override
  public TaskState getTaskState() {
    return taskState;
  }

  @JsonProperty(value = "taskConfiguration")
  @Override
  public TaskConfiguration getTaskConfiguration() {
    return taskConfiguration;
  }

  @Override
  public String toString() {
    return "Task{"
        + "taskState=" + taskState + ", "
        + "taskConfiguration=" + taskConfiguration
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof Task) {
      Task that = (Task) o;
      return (this.taskState.equals(that.getTaskState()))
           && (this.taskConfiguration.equals(that.getTaskConfiguration()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h = 1;
    h *= 1000003;
    h ^= this.taskState.hashCode();
    h *= 1000003;
    h ^= this.taskConfiguration.hashCode();
    return h;
  }

  private static final long serialVersionUID = 42L;

  static final class Builder extends Task.Builder {
    private TaskState taskState;
    private TaskConfiguration taskConfiguration;
    Builder() {
    }
    @Override
    public Task.Builder setTaskState(TaskState taskState) {
      if (taskState == null) {
        throw new NullPointerException("Null taskState");
      }
      this.taskState = taskState;
      return this;
    }
    @Override
    public Task.Builder setTaskConfiguration(TaskConfiguration taskConfiguration) {
      if (taskConfiguration == null) {
        throw new NullPointerException("Null taskConfiguration");
      }
      this.taskConfiguration = taskConfiguration;
      return this;
    }
    @Override
    public Task build() {
      String missing = "";
      if (this.taskState == null) {
        missing += " taskState";
      }
      if (this.taskConfiguration == null) {
        missing += " taskConfiguration";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_Task(
          this.taskState,
          this.taskConfiguration);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy