List of utility methods to do AbstractMap Usage
Entry | splitIntSuffix(String string) split Int Suffix for (int i = 0; i < string.length(); i++) { try { int suffix = Integer.parseInt(string.substring(i)); return new AbstractMap.SimpleEntry<String, Integer>(string.substring(0, i), suffix); } catch (NumberFormatException e) { return null; ... |
SimpleImmutableEntry | splitQueryParam(String param) split Query Param String[] keyVal = param.split("="); if (keyVal.length == 1) return new SimpleImmutableEntry<String, String>(keyVal[1], null); if (keyVal.length > 1) return new SimpleImmutableEntry<String, String>(keyVal[0], keyVal[1]); throw new IllegalArgumentException("The param doesn't contain any value"); |