gov.nasa.pds.api.registry.search.RequestConstructionContextFactory 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.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import gov.nasa.pds.api.registry.RequestConstructionContext;
public class RequestConstructionContextFactory {
public static RequestConstructionContext minimal() {
return new SimpleRequestConstructionContext(new HashMap<>(), true);
}
public static RequestConstructionContext given(String lidvid) {
return new SimpleRequestConstructionContext(lidvid);
}
public static RequestConstructionContext given(List lidvids) {
Map> kvps = new HashMap>();
kvps.put("lidvid", lidvids);
return new SimpleRequestConstructionContext(kvps, true);
}
public static RequestConstructionContext given(String key, String value, boolean asTerm) {
List values = Arrays.asList(value);
Map> kvps = new HashMap>();
kvps.put(key, values);
return new SimpleRequestConstructionContext(kvps, asTerm);
}
public static RequestConstructionContext given(String key, List values, boolean asTerm) {
Map> kvps = new HashMap>();
kvps.put(key, values);
return new SimpleRequestConstructionContext(kvps, asTerm);
}
}