feat: Add Espresso options by mykola-mokhnach · Pull Request #1563 · appium/java-client
| public Optional<Map<String, Integer>> getEi() { | |
| Optional<Map<String, Object>> value = getOptionValue("ei"); | |
| return value.map((v) -> v.entrySet().stream() | |
| .collect(Collectors.toMap( | |
| Map.Entry::getKey, (entry) -> Integer.parseInt(String.valueOf(entry.getValue()))) | |
| ) | |
| ); | |
| } | |
| public Optional<Map<String, Integer>> getEi() { | |
| Optional<Map<String, Object>> value = getOptionValue("ei"); | |
| return value.map((v) -> convertMapValues(v, Integer::parseInt)); | |
| } | |
| private <T> Map<String, T> convertMapValues(Map<String, Object> map, Function<String, T> converter) { | |
| return map.entrySet().stream().collect( | |
| Collectors.toMap(Map.Entry::getKey, (entry) -> converter.apply(String.valueOf(entry.getValue())))); | |
| } |