@Test public void getParameterAsLong_shouldReturnValue() { Map<String, List<String>> data = Map.of(KEY, List.of("1")); long result = getParameterValueAsLong(data, KEY); assertEquals(1L, result); }
public static long getParameterValueAsLong( final Map<String, List<String>> parameterMap, final String key) throws IllegalArgumentException { String stringValue = validateQueryParameter(parameterMap, key); try { return Long.parseLong(stringValue); } catch (IllegalArgumentException ex) { throw new IllegalArgumentException(INVALID_NUMERIC_VALUE); } }
SingleQueryParameterUtils { public static long getParameterValueAsLong( final Map<String, List<String>> parameterMap, final String key) throws IllegalArgumentException { String stringValue = validateQueryParameter(parameterMap, key); try { return Long.parseLong(stringValue); } catch (IllegalArgumentException ex) { throw new IllegalArgumentException(INVALID_NUMERIC_VALUE); } } }
SingleQueryParameterUtils { public static long getParameterValueAsLong( final Map<String, List<String>> parameterMap, final String key) throws IllegalArgumentException { String stringValue = validateQueryParameter(parameterMap, key); try { return Long.parseLong(stringValue); } catch (IllegalArgumentException ex) { throw new IllegalArgumentException(INVALID_NUMERIC_VALUE); } }  }
SingleQueryParameterUtils { public static long getParameterValueAsLong( final Map<String, List<String>> parameterMap, final String key) throws IllegalArgumentException { String stringValue = validateQueryParameter(parameterMap, key); try { return Long.parseLong(stringValue); } catch (IllegalArgumentException ex) { throw new IllegalArgumentException(INVALID_NUMERIC_VALUE); } }  static String validateQueryParameter(
      final Map<String, List<String>> parameterMap, final String key); static int getParameterValueAsInt(
      final Map<String, List<String>> parameterMap, final String key); static UInt64 getParameterValueAsUInt64(
      final Map<String, List<String>> parameterMap, final String key); static UInt64 getParameterValueAsEpoch(
      final Map<String, List<String>> parameterMap, final String key); static long getParameterValueAsLong(
      final Map<String, List<String>> parameterMap, final String key); static Bytes32 getParameterValueAsBytes32(
      final Map<String, List<String>> parameterMap, final String key); static BLSSignature getParameterValueAsBLSSignature(
      final Map<String, List<String>> parameterMap, final String key); }
SingleQueryParameterUtils { public static long getParameterValueAsLong( final Map<String, List<String>> parameterMap, final String key) throws IllegalArgumentException { String stringValue = validateQueryParameter(parameterMap, key); try { return Long.parseLong(stringValue); } catch (IllegalArgumentException ex) { throw new IllegalArgumentException(INVALID_NUMERIC_VALUE); } }  static String validateQueryParameter(
      final Map<String, List<String>> parameterMap, final String key); static int getParameterValueAsInt(
      final Map<String, List<String>> parameterMap, final String key); static UInt64 getParameterValueAsUInt64(
      final Map<String, List<String>> parameterMap, final String key); static UInt64 getParameterValueAsEpoch(
      final Map<String, List<String>> parameterMap, final String key); static long getParameterValueAsLong(
      final Map<String, List<String>> parameterMap, final String key); static Bytes32 getParameterValueAsBytes32(
      final Map<String, List<String>> parameterMap, final String key); static BLSSignature getParameterValueAsBLSSignature(
      final Map<String, List<String>> parameterMap, final String key); static final String INVALID_BYTES32_DATA; static final String INVALID_BYTES96_DATA; static final String INVALID_NUMERIC_VALUE; static final String NULL_OR_EMPTY_FORMAT; static final String MUST_SPECIFY_ONLY_ONCE; }