@Test public void testGetParameters() throws Exception { Map<String, List> collected; collected = new SearchContext(null, 0, 0, null, false).getParameters(); assertNotNull(collected); assertTrue(collected.isEmpty()); collected = new SearchContext(Collections.singletonMap("abc", Collections.singletonList("def")), 0, 0, null, false).getParameters(); assertNotNull(collected); assertTrue(collected.isEmpty()); collected = new SearchContext(Collections.singletonMap("abc", Collections.singletonList("def")), 0, 0, null, false, "foo").getParameters(); assertNotNull(collected); assertTrue(collected.isEmpty()); collected = new SearchContext(Collections.singletonMap("abc", Collections.singletonList("def")), 0, 0, null, false, "foo", "abc").getParameters(); assertNotNull(collected); assertFalse(collected.isEmpty()); assertEquals(Collections.singletonList("def"), collected.get("abc")); collected = new SearchContext(Collections.singletonMap("abc", Arrays.asList("def", null, "")), 0, 0, null, false, "foo", "abc").getParameters(); assertNotNull(collected); assertFalse(collected.isEmpty()); assertEquals(Collections.singletonList("def"), collected.get("abc")); final Instant now = Instant.now(); collected = new SearchContext(Collections.singletonMap("abc", Collections.singletonList(now)), 0, 0, null, false, "foo", "abc").getParameters(); assertNotNull(collected); assertFalse(collected.isEmpty()); assertEquals(Collections.singletonList(now), collected.get("abc")); final Pair<SearchContext.MatchMode, Object> from = SearchContext.MatchMode.GT.toParam(now); final Pair<SearchContext.MatchMode, Object> to = SearchContext.MatchMode.LT.toParam(now); collected = new SearchContext(Collections.singletonMap("abc", Arrays.asList(from, to)), 0, 0, null, false, "foo", "abc").getParameters(); assertNotNull(collected); assertFalse(collected.isEmpty()); assertEquals(Arrays.asList(from, to), collected.get("abc")); }
public Map<String, List> getParameters() { return Collections.unmodifiableMap(parameters); }
SearchContext { public Map<String, List> getParameters() { return Collections.unmodifiableMap(parameters); } }
SearchContext { public Map<String, List> getParameters() { return Collections.unmodifiableMap(parameters); } SearchContext(final Map<String, List> parameters,
                         final int start,
                         final int size,
                         final String sortBy,
                         final boolean sortDesc,
                         final String ... allowed); }
SearchContext { public Map<String, List> getParameters() { return Collections.unmodifiableMap(parameters); } SearchContext(final Map<String, List> parameters,
                         final int start,
                         final int size,
                         final String sortBy,
                         final boolean sortDesc,
                         final String ... allowed); Map<String, List> getParameters(); Map<String, List> reduceParameters(final String ... allowed); Map<String, List> expandParameter(final String key, final String ... expand); int getStart(); int getSize(); String getSortBy(); boolean isSortDesc(); }
SearchContext { public Map<String, List> getParameters() { return Collections.unmodifiableMap(parameters); } SearchContext(final Map<String, List> parameters,
                         final int start,
                         final int size,
                         final String sortBy,
                         final boolean sortDesc,
                         final String ... allowed); Map<String, List> getParameters(); Map<String, List> reduceParameters(final String ... allowed); Map<String, List> expandParameter(final String key, final String ... expand); int getStart(); int getSize(); String getSortBy(); boolean isSortDesc(); static final String JOIN; }