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

com.algolia.search.models.indexing.IndexingResponse Maven / Gradle / Ivy

The newest version!
package com.algolia.search.models.indexing;

import com.algolia.search.models.WaitableResponse;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.function.Consumer;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@SuppressWarnings("WeakerAccess")
public class IndexingResponse implements WaitableResponse, Serializable {

  private Long taskID;
  private Consumer waitConsumer;

  public Long getTaskID() {
    return taskID;
  }

  public IndexingResponse setTaskID(Long taskID) {
    this.taskID = taskID;
    return this;
  }

  public void setWaitConsumer(Consumer waitConsumer) {
    this.waitConsumer = waitConsumer;
  }

  @Override
  public void waitTask() {
    waitConsumer.accept(getTaskID());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy