@Test public void textListAt() { ObjectNode node = newObject(); node.putArray("foo").add("hello").add("world"); List<String> value = Selectors.textListAt(node, FOO_FIELD); assertThat(value, contains("hello", "world")); }
public static List<String> textListAt(JsonNode node, JsonPointer pointer) { node = node.at(pointer); if (node.isMissingNode()) { return Collections.emptyList(); } if (!node.isArray()) { throw new WrongTypeException(pointer, "not a list"); } return StreamSupport.stream(node.spliterator(), false) .filter(JsonNode::isTextual) .map(JsonNode::asText) .collect(Collectors.toList()); }
Selectors { public static List<String> textListAt(JsonNode node, JsonPointer pointer) { node = node.at(pointer); if (node.isMissingNode()) { return Collections.emptyList(); } if (!node.isArray()) { throw new WrongTypeException(pointer, "not a list"); } return StreamSupport.stream(node.spliterator(), false) .filter(JsonNode::isTextual) .map(JsonNode::asText) .collect(Collectors.toList()); } }
Selectors { public static List<String> textListAt(JsonNode node, JsonPointer pointer) { node = node.at(pointer); if (node.isMissingNode()) { return Collections.emptyList(); } if (!node.isArray()) { throw new WrongTypeException(pointer, "not a list"); } return StreamSupport.stream(node.spliterator(), false) .filter(JsonNode::isTextual) .map(JsonNode::asText) .collect(Collectors.toList()); }  }
Selectors { public static List<String> textListAt(JsonNode node, JsonPointer pointer) { node = node.at(pointer); if (node.isMissingNode()) { return Collections.emptyList(); } if (!node.isArray()) { throw new WrongTypeException(pointer, "not a list"); } return StreamSupport.stream(node.spliterator(), false) .filter(JsonNode::isTextual) .map(JsonNode::asText) .collect(Collectors.toList()); }  static String textAt(JsonNode node, JsonPointer pointer); static int integerAt(JsonNode node, JsonPointer pointer); static Iterable<? extends JsonNode> listAt(JsonNode node, JsonPointer pointer); static List<String> textListAt(JsonNode node, JsonPointer pointer); static Map<String, String> propertiesAt(JsonNode node, JsonPointer pointer); }
Selectors { public static List<String> textListAt(JsonNode node, JsonPointer pointer) { node = node.at(pointer); if (node.isMissingNode()) { return Collections.emptyList(); } if (!node.isArray()) { throw new WrongTypeException(pointer, "not a list"); } return StreamSupport.stream(node.spliterator(), false) .filter(JsonNode::isTextual) .map(JsonNode::asText) .collect(Collectors.toList()); }  static String textAt(JsonNode node, JsonPointer pointer); static int integerAt(JsonNode node, JsonPointer pointer); static Iterable<? extends JsonNode> listAt(JsonNode node, JsonPointer pointer); static List<String> textListAt(JsonNode node, JsonPointer pointer); static Map<String, String> propertiesAt(JsonNode node, JsonPointer pointer);  }