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

com.factual.driver.Clear Maven / Gradle / Ivy

The newest version!
package com.factual.driver;

import java.util.List;
import java.util.Map;

public class Clear {
  private final Parameters queryParams = new Parameters();

  public Clear() {
  }

  /**
   * Constructor for a submit with values initialized as key value pairs in
   * mapping.
   */
  public Clear(List fields) {
    for (String field : fields)
      addField(field);
  }

  protected String toUrlQuery() {
    return UrlUtil.toUrlQuery(toUrlParams());
  }

  /**
   * Add the name of a field to be cleared in this request
   * 
   * @param field
   *          the field name
   * @return this Clear
   */
  public Clear addField(String field) {
    queryParams.addCommaSeparatedParam(Constants.CLEAR_FIELDS, field);
    return this;
  }

  protected Map toUrlParams() {
    return queryParams.toUrlParams(null);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy