Changeset 16385 in josm for trunk/scripts
- Timestamp:
- 2020-04-28T22:24:09+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/TagInfoExtract.java
r16384 r16385 283 283 optionalTags.compute(new Tag(item.key, value), (osmTag, tagInfoTag) -> { 284 284 if (tagInfoTag == null) { 285 String description = descriptionPrefix + "Optional for: " + preset.getName();285 String description = descriptionPrefix + TagInfoTag.OPTIONAL_FOR_COUNT + ": " + preset.getName(); 286 286 return new TagInfoTag(description, item.key, value, types, null); 287 287 } else { … … 551 551 */ 552 552 private static class TagInfoTag { 553 static final String OPTIONAL_FOR_COUNT = "Optional for {count}"; 553 554 final Collection<String> descriptions = new ArrayList<>(); 554 555 final String key; … … 570 571 final JsonObjectBuilder object = Json.createObjectBuilder(); 571 572 if (!descriptions.isEmpty()) { 572 object.add("description", String.join(", ", Utils.limit(descriptions, 8, "..."))); 573 final int size = descriptions.size(); 574 object.add("description", String.join(", ", Utils.limit(descriptions, 8, "...")) 575 .replace(OPTIONAL_FOR_COUNT, size > 3 ? "Optional for " + size : "Optional for")); 573 576 } 574 577 object.add("key", key);
Note:
See TracChangeset
for help on using the changeset viewer.