
io.searchbox.indices.template.PutTemplate 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.indices.template;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
/**
* @author asierdelpozo
* @author cihat keser
*/
public class PutTemplate extends TemplateAction {
protected PutTemplate(Builder builder) {
super(builder);
this.payload = builder.source;
setURI(buildURI());
}
@Override
public String getRestMethodName() {
return "PUT";
}
@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 TemplateAction.Builder {
private Object source;
public Builder(String template, Object source) {
super(template);
this.source = source;
}
@Override
public PutTemplate build() {
return new PutTemplate(this);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy