main.java.com.cloudant.client.api.model.Params Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudant-client Show documentation
Show all versions of cloudant-client Show documentation
Official Cloudant client for Java
package com.cloudant.client.api.model;
import java.util.List;
import com.cloudant.client.api.Database;
/**
* Query parameters to append to find requests.
* Example:
*
* Database.find(Foo.class, "doc-id", new Params().readQuorum(3));
*
* @see Database#find(Class, String, Params)
* @since 0.0.1
* @author Mario Briggs
*
*/
public class Params {
private org.lightcouch.Params params = new org.lightcouch.Params();
public Params readQuorum(int quorum) {
params.addParam("r", new Integer(quorum).toString());
return this;
}
public Params attachments() {
params = params.attachments();
return this ;
}
public Params revisions() {
params = params.revisions();
return this ;
}
public Params conflicts() {
params = params.conflicts();
return this ;
}
public Params addParam(String name, String value) {
params = params.addParam(name, value);
return this ;
}
public boolean equals(Object obj) {
return params.equals(obj);
}
public List getParams() {
return params.getParams();
}
public int hashCode() {
return params.hashCode();
}
public Params revsInfo() {
params = params.revsInfo();
return this ;
}
public Params rev(String rev) {
params = params.rev(rev);
return this ;
}
public Params localSeq() {
params = params.localSeq();
return this ;
}
public String toString() {
return params.toString();
}
public org.lightcouch.Params getInternalParams() {
return params;
}
}