org.elasticsearch.xpack.core.async.DeleteAsyncResultRequest Maven / Gradle / Ivy
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
package org.elasticsearch.xpack.core.async;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
import java.util.Objects;
public class DeleteAsyncResultRequest extends ActionRequest {
private final String id;
public DeleteAsyncResultRequest(String id) {
this.id = id;
}
public DeleteAsyncResultRequest(StreamInput in) throws IOException {
super(in);
this.id = in.readString();
}
@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeString(id);
}
@Override
public ActionRequestValidationException validate() {
return null;
}
public String getId() {
return id;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DeleteAsyncResultRequest request = (DeleteAsyncResultRequest) o;
return id.equals(request.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
}