Example usage for org.apache.wicket.request IRequestParameters getParameterNames

List of usage examples for org.apache.wicket.request IRequestParameters getParameterNames

Introduction

In this page you can find the example usage for org.apache.wicket.request IRequestParameters getParameterNames.

Prototype

Set<String> getParameterNames();

Source Link

Document

Returns immutable set of all available parameter names.

Usage

From source file:org.sakaiproject.gradebookng.tool.panels.BasePanel.java

License:Educational Community License

/**
 * Get the Rubric request parameters// w  w  w  . java 2  s .co  m
 *
 * @return A map with key and value of those parameters
 */
protected HashMap<String, String> getRubricParameters(final String entityId) {
    final HashMap<String, String> list = new HashMap<String, String>();

    String entity = RubricsConstants.RBCS_PREFIX;
    if (entityId != null && !entityId.isEmpty()) {
        entity += entityId + "-";
    }
    final String startsWith = entity;

    final IRequestParameters parameters = RequestCycle.get().getRequest().getPostParameters();
    parameters.getParameterNames().forEach((value) -> {
        if (value.startsWith(startsWith)) {
            list.put(value, parameters.getParameterValue(value).toString());
        }
    });

    return list;
}