@Test public void integerList_shouldHandleSingleEntry() { final Map<String, List<String>> data = Map.of("index", List.of("1")); assertThat(ListQueryParameterUtils.getParameterAsIntegerList(data, "index")) .isEqualTo(List.of(1)); }
public static List<Integer> getParameterAsIntegerList( final Map<String, List<String>> parameterMap, final String key) throws IllegalArgumentException { String integerList = ""; try { integerList = String.join(",", validateQueryParameter(parameterMap, key)); return splitter .splitToStream(integerList) .map(Integer::parseUnsignedInt) .collect(Collectors.toList()); } catch (NumberFormatException ex) { throw new IllegalArgumentException( String.format("Failed to parse query parameter (%s:%s) to Integers", key, integerList), ex); } }
ListQueryParameterUtils { public static List<Integer> getParameterAsIntegerList( final Map<String, List<String>> parameterMap, final String key) throws IllegalArgumentException { String integerList = ""; try { integerList = String.join(",", validateQueryParameter(parameterMap, key)); return splitter .splitToStream(integerList) .map(Integer::parseUnsignedInt) .collect(Collectors.toList()); } catch (NumberFormatException ex) { throw new IllegalArgumentException( String.format("Failed to parse query parameter (%s:%s) to Integers", key, integerList), ex); } } }
ListQueryParameterUtils { public static List<Integer> getParameterAsIntegerList( final Map<String, List<String>> parameterMap, final String key) throws IllegalArgumentException { String integerList = ""; try { integerList = String.join(",", validateQueryParameter(parameterMap, key)); return splitter .splitToStream(integerList) .map(Integer::parseUnsignedInt) .collect(Collectors.toList()); } catch (NumberFormatException ex) { throw new IllegalArgumentException( String.format("Failed to parse query parameter (%s:%s) to Integers", key, integerList), ex); } }  }
ListQueryParameterUtils { public static List<Integer> getParameterAsIntegerList( final Map<String, List<String>> parameterMap, final String key) throws IllegalArgumentException { String integerList = ""; try { integerList = String.join(",", validateQueryParameter(parameterMap, key)); return splitter .splitToStream(integerList) .map(Integer::parseUnsignedInt) .collect(Collectors.toList()); } catch (NumberFormatException ex) { throw new IllegalArgumentException( String.format("Failed to parse query parameter (%s:%s) to Integers", key, integerList), ex); } }  static List<Integer> getParameterAsIntegerList(
      final Map<String, List<String>> parameterMap, final String key); static List<String> getParameterAsStringList(
      final Map<String, List<String>> parameterMap, final String key); }
ListQueryParameterUtils { public static List<Integer> getParameterAsIntegerList( final Map<String, List<String>> parameterMap, final String key) throws IllegalArgumentException { String integerList = ""; try { integerList = String.join(",", validateQueryParameter(parameterMap, key)); return splitter .splitToStream(integerList) .map(Integer::parseUnsignedInt) .collect(Collectors.toList()); } catch (NumberFormatException ex) { throw new IllegalArgumentException( String.format("Failed to parse query parameter (%s:%s) to Integers", key, integerList), ex); } }  static List<Integer> getParameterAsIntegerList(
      final Map<String, List<String>> parameterMap, final String key); static List<String> getParameterAsStringList(
      final Map<String, List<String>> parameterMap, final String key); static final String MISSING_QUERY_PARAMETER; static final Splitter splitter; }