@Test public void testPageParametersAsMap() throws Exception { final CommandConfig commandConfig = context.mock(CommandConfig.class, "config"); context.checking(new Expectations() {{ allowing(commandConfig).isCommandKey("asd"); will(returnValue(false)); allowing(commandConfig).isCommandKey("cmd1"); will(returnValue(true)); allowing(commandConfig).isCommandKey("cmd2"); will(returnValue(true)); allowing(commandConfig).isInternalCommandKey("asd"); will(returnValue(false)); allowing(commandConfig).isInternalCommandKey("cmd1"); will(returnValue(true)); allowing(commandConfig).isInternalCommandKey("cmd2"); will(returnValue(false)); }}); PageParameters parametersToFilter = new PageParameters() .add("cmd1", "val1") .add("asd", "dsa") .add("cmd2", "ppp"); assertEquals(3, parametersToFilter.getNamedKeys().size()); Map<String, String> filtered = new WicketUtil(commandConfig).pageParametersAsMap(parametersToFilter); assertNotNull(filtered); assertEquals(2, filtered.size()); assertEquals("ppp", filtered.get("cmd2")); assertEquals("dsa", filtered.get("asd")); }
public Map<String, String> pageParametersAsMap(final PageParameters pageParameters) { final Map<String, String> map = new LinkedHashMap<>(); if (pageParameters != null) { for (String key : pageParameters.getNamedKeys()) { if (!commandConfig.isInternalCommandKey(key)) { map.put(key, pageParameters.get(key).toString()); } } } return map; }
WicketUtil { public Map<String, String> pageParametersAsMap(final PageParameters pageParameters) { final Map<String, String> map = new LinkedHashMap<>(); if (pageParameters != null) { for (String key : pageParameters.getNamedKeys()) { if (!commandConfig.isInternalCommandKey(key)) { map.put(key, pageParameters.get(key).toString()); } } } return map; } }
WicketUtil { public Map<String, String> pageParametersAsMap(final PageParameters pageParameters) { final Map<String, String> map = new LinkedHashMap<>(); if (pageParameters != null) { for (String key : pageParameters.getNamedKeys()) { if (!commandConfig.isInternalCommandKey(key)) { map.put(key, pageParameters.get(key).toString()); } } } return map; } WicketUtil();  WicketUtil(final CommandConfig commandConfig); }
WicketUtil { public Map<String, String> pageParametersAsMap(final PageParameters pageParameters) { final Map<String, String> map = new LinkedHashMap<>(); if (pageParameters != null) { for (String key : pageParameters.getNamedKeys()) { if (!commandConfig.isInternalCommandKey(key)) { map.put(key, pageParameters.get(key).toString()); } } } return map; } WicketUtil();  WicketUtil(final CommandConfig commandConfig); HttpServletRequest getHttpServletRequest(); long getCategoryId(final PageParameters pageParameters); Map<String, String> pageParametersAsMap(final PageParameters pageParameters); Map<String, List<String>> pageParametersAsMultiMap(final PageParameters pageParameters); PageParameters getFilteredRequestParameters(final PageParameters parameters); PageParameters getFilteredRequestParameters(final PageParameters pageParameters,
                                                              final Collection<String> nameFilter); PageParameters getFilteredRequestParameters(final PageParameters parameters,
                                                              final String key,
                                                              final String value); PageParameters getRetainedRequestParameters(final PageParameters pageParameters,
                                                              final Set<String> nameFilter); int getSelectedItemsPerPage(final PageParameters pageParameters, final List<String> itemsPerPageValues); boolean isSelectedProductSortOnPage(final PageParameters pageParameters, final String sortOrder, final String sortField); boolean isSelectedPageActive(final PageParameters pageParameters, final String pageParameterName, final int page); String constructLatinStringValue(final String ... values); static StringResourceModel createStringResourceModel(final Component component,
                                                                final String resourceKey); static StringResourceModel createStringResourceModel(final Component component,
                                                                final String resourceKey,
                                                                final Map<String, Object> parameters); }
WicketUtil { public Map<String, String> pageParametersAsMap(final PageParameters pageParameters) { final Map<String, String> map = new LinkedHashMap<>(); if (pageParameters != null) { for (String key : pageParameters.getNamedKeys()) { if (!commandConfig.isInternalCommandKey(key)) { map.put(key, pageParameters.get(key).toString()); } } } return map; } WicketUtil();  WicketUtil(final CommandConfig commandConfig); HttpServletRequest getHttpServletRequest(); long getCategoryId(final PageParameters pageParameters); Map<String, String> pageParametersAsMap(final PageParameters pageParameters); Map<String, List<String>> pageParametersAsMultiMap(final PageParameters pageParameters); PageParameters getFilteredRequestParameters(final PageParameters parameters); PageParameters getFilteredRequestParameters(final PageParameters pageParameters,
                                                              final Collection<String> nameFilter); PageParameters getFilteredRequestParameters(final PageParameters parameters,
                                                              final String key,
                                                              final String value); PageParameters getRetainedRequestParameters(final PageParameters pageParameters,
                                                              final Set<String> nameFilter); int getSelectedItemsPerPage(final PageParameters pageParameters, final List<String> itemsPerPageValues); boolean isSelectedProductSortOnPage(final PageParameters pageParameters, final String sortOrder, final String sortField); boolean isSelectedPageActive(final PageParameters pageParameters, final String pageParameterName, final int page); String constructLatinStringValue(final String ... values); static StringResourceModel createStringResourceModel(final Component component,
                                                                final String resourceKey); static StringResourceModel createStringResourceModel(final Component component,
                                                                final String resourceKey,
                                                                final Map<String, Object> parameters);  }