
io.searchbox.core.Explain Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jest-common Show documentation
Show all versions of jest-common Show documentation
ElasticSearch Java REST client - shared library package
package io.searchbox.core;
import io.searchbox.action.SingleResultAbstractDocumentTargetedAction;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
/**
* @author Dogukan Sonmez
* @author cihat keser
*/
public class Explain extends SingleResultAbstractDocumentTargetedAction {
protected Explain(Builder builder) {
super(builder);
setURI(buildURI());
this.payload = builder.query;
}
@Override
public String getRestMethodName() {
return "GET";
}
@Override
protected String buildURI() {
return super.buildURI() + "/_explain";
}
@Override
public int hashCode() {
return new HashCodeBuilder()
.appendSuper(super.hashCode())
.toHashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (obj == this) {
return true;
}
if (obj.getClass() != getClass()) {
return false;
}
return new EqualsBuilder()
.appendSuper(super.equals(obj))
.isEquals();
}
public static class Builder extends SingleResultAbstractDocumentTargetedAction.Builder {
private final Object query;
public Builder(String index, String type, String id, Object query) {
this.index(index);
this.type(type);
this.id(id);
this.query = query;
}
public Explain build() {
return new Explain(this);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy