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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy