com.braintreegateway.SearchNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.apache.servicemix.bundles.braintree-java
Show all versions of org.apache.servicemix.bundles.braintree-java
This OSGi bundle wraps ${pkgArtifactId} ${pkgVersion} jar file.
package com.braintreegateway;
import java.util.List;
public class SearchNode {
protected String nodeName;
protected T parent;
public SearchNode(String nodeName, T parent) {
this.nodeName = nodeName;
this.parent = parent;
}
protected T assembleCriteria(String operation, String value) {
this.parent.addCriteria(this.nodeName, new SearchCriteria(operation, defaultWithEmptyString(value)));
return this.parent;
}
protected T assembleMultiValueCriteria(List> items) {
this.parent.addMultipleValueCriteria(this.nodeName, new SearchCriteria(items));
return this.parent;
}
private String defaultWithEmptyString(String value) {
if (value == null) {
return "";
} else {
return value;
}
}
}