gov.nasa.pds.api.registry.search.SimpleRequestConstructionContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of registry-api-service Show documentation
Show all versions of registry-api-service Show documentation
Registry API Service contributing to the PDS Federated Search API
package gov.nasa.pds.api.registry.search;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import gov.nasa.pds.api.registry.RequestConstructionContext;
import gov.nasa.pds.api.registry.model.identifiers.PdsProductIdentifier;
class SimpleRequestConstructionContext implements RequestConstructionContext {
final private boolean isTerm;
final private Map> kvps;
final private PdsProductIdentifier productIdentifier;
SimpleRequestConstructionContext(Map> kvps) {
this.isTerm = false;
this.kvps = kvps;
this.productIdentifier = null;
}
SimpleRequestConstructionContext(Map> kvps, boolean asTerm) {
this.isTerm = asTerm;
this.kvps = kvps;
this.productIdentifier = null;
}
SimpleRequestConstructionContext(String productIdentifier) {
this.isTerm = false;
this.kvps = new HashMap>();
this.productIdentifier = PdsProductIdentifier.fromString(productIdentifier);
}
SimpleRequestConstructionContext(String productIdentifier, boolean isTerm) {
this.isTerm = isTerm;
this.kvps = new HashMap>();
this.productIdentifier = PdsProductIdentifier.fromString(productIdentifier);
}
@Override
public List getKeywords() {
return new ArrayList();
}
@Override
public Map> getKeyValuePairs() {
return this.kvps;
}
@Override
public PdsProductIdentifier getProductIdentifier() {
return this.productIdentifier;
}
@Override
public String getProductIdentifierString() {
return this.productIdentifier == null ? "" : this.productIdentifier.toString();
}
@Override
public String getQueryString() {
return "";
}
@Override
public boolean isTerm() {
return this.isTerm;
}
}