All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gov.nasa.pds.api.registry.search.RequestConstructionContextFactory Maven / Gradle / Ivy

There is a newer version: 4.5.6
Show newest version
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);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy