@Test public void getMember() { StringNode strNode = Node.from("John Doe"); HashMap<StringNode, Node> members = new HashMap<>(); members.put(Node.from("name"), strNode); ObjectNode node = Node.objectNode(members); assertEquals(strNode, node.getMember("name").get()); assertFalse(node.getMember("age").isPresent()); }
public Optional<Node> getMember(String memberName) { return Optional.ofNullable(getStringMap().get(memberName)); }
ObjectNode extends Node implements ToSmithyBuilder<ObjectNode> { public Optional<Node> getMember(String memberName) { return Optional.ofNullable(getStringMap().get(memberName)); } }
ObjectNode extends Node implements ToSmithyBuilder<ObjectNode> { public Optional<Node> getMember(String memberName) { return Optional.ofNullable(getStringMap().get(memberName)); } ObjectNode(Map<StringNode, Node> members, SourceLocation sourceLocation);   ObjectNode(Map<StringNode, Node> nodeMap, SourceLocation sourceLocation, boolean defensiveCopy); }
ObjectNode extends Node implements ToSmithyBuilder<ObjectNode> { public Optional<Node> getMember(String memberName) { return Optional.ofNullable(getStringMap().get(memberName)); } ObjectNode(Map<StringNode, Node> members, SourceLocation sourceLocation);   ObjectNode(Map<StringNode, Node> nodeMap, SourceLocation sourceLocation, boolean defensiveCopy); static ObjectNode fromStringMap(Map<String, String> map); @Override NodeType getType(); @Override R accept(NodeVisitor<R> visitor); @Override ObjectNode expectObjectNode(String errorMessage); @Override Optional<ObjectNode> asObjectNode(); ObjectNode withMember(StringNode key, T value); ObjectNode withMember(String key, T value); ObjectNode withMember(String key, String value); ObjectNode withMember(String key, boolean value); ObjectNode withMember(String key, Number value); ObjectNode withOptionalMember(String key, Optional<T> value); ObjectNode withoutMember(String memberName); Map<StringNode, Node> getMembers(); boolean containsMember(String memberName); Optional<Node> getMember(String memberName); Map<String, Node> getMembersByPrefix(String prefix); Map<String, Node> getStringMap(); Optional<StringNode> getStringMember(String memberName); String getStringMemberOrDefault(String memberName, String defaultValue); Optional<NumberNode> getNumberMember(String memberName); Number getNumberMemberOrDefault(String memberName, Number defaultValue); Optional<ArrayNode> getArrayMember(String memberName); Optional<ObjectNode> getObjectMember(String memberName); Optional<BooleanNode> getBooleanMember(String memberName); Boolean getBooleanMemberOrDefault(String memberName, Boolean defaultValue); boolean getBooleanMemberOrDefault(String memberName); Node expectMember(String name); Node expectMember(String name, String errorMessage); ArrayNode expectArrayMember(String name); BooleanNode expectBooleanMember(String name); NullNode expectNullMember(String name); NumberNode expectNumberMember(String name); ObjectNode expectObjectMember(String name); StringNode expectStringMember(String name); ObjectNode expectNoAdditionalProperties(Collection<String> allowedProperties); ObjectNode warnIfAdditionalProperties(Collection<String> allowedProperties); boolean isEmpty(); int size(); ObjectNode merge(ObjectNode other); static Collector<T, Map<StringNode, Node>, ObjectNode> collect(
            Function<T, StringNode> keyMapper,
            Function<T, ToNode> valueMapper
    ); static Collector<T, Map<StringNode, Node>, ObjectNode> collectStringKeys(
            Function<T, String> keyMapper,
            Function<T, ToNode> valueMapper
    ); @Override boolean equals(Object other); @Override int hashCode(); @Override Builder toBuilder(); }
ObjectNode extends Node implements ToSmithyBuilder<ObjectNode> { public Optional<Node> getMember(String memberName) { return Optional.ofNullable(getStringMap().get(memberName)); } ObjectNode(Map<StringNode, Node> members, SourceLocation sourceLocation);   ObjectNode(Map<StringNode, Node> nodeMap, SourceLocation sourceLocation, boolean defensiveCopy); static ObjectNode fromStringMap(Map<String, String> map); @Override NodeType getType(); @Override R accept(NodeVisitor<R> visitor); @Override ObjectNode expectObjectNode(String errorMessage); @Override Optional<ObjectNode> asObjectNode(); ObjectNode withMember(StringNode key, T value); ObjectNode withMember(String key, T value); ObjectNode withMember(String key, String value); ObjectNode withMember(String key, boolean value); ObjectNode withMember(String key, Number value); ObjectNode withOptionalMember(String key, Optional<T> value); ObjectNode withoutMember(String memberName); Map<StringNode, Node> getMembers(); boolean containsMember(String memberName); Optional<Node> getMember(String memberName); Map<String, Node> getMembersByPrefix(String prefix); Map<String, Node> getStringMap(); Optional<StringNode> getStringMember(String memberName); String getStringMemberOrDefault(String memberName, String defaultValue); Optional<NumberNode> getNumberMember(String memberName); Number getNumberMemberOrDefault(String memberName, Number defaultValue); Optional<ArrayNode> getArrayMember(String memberName); Optional<ObjectNode> getObjectMember(String memberName); Optional<BooleanNode> getBooleanMember(String memberName); Boolean getBooleanMemberOrDefault(String memberName, Boolean defaultValue); boolean getBooleanMemberOrDefault(String memberName); Node expectMember(String name); Node expectMember(String name, String errorMessage); ArrayNode expectArrayMember(String name); BooleanNode expectBooleanMember(String name); NullNode expectNullMember(String name); NumberNode expectNumberMember(String name); ObjectNode expectObjectMember(String name); StringNode expectStringMember(String name); ObjectNode expectNoAdditionalProperties(Collection<String> allowedProperties); ObjectNode warnIfAdditionalProperties(Collection<String> allowedProperties); boolean isEmpty(); int size(); ObjectNode merge(ObjectNode other); static Collector<T, Map<StringNode, Node>, ObjectNode> collect(
            Function<T, StringNode> keyMapper,
            Function<T, ToNode> valueMapper
    ); static Collector<T, Map<StringNode, Node>, ObjectNode> collectStringKeys(
            Function<T, String> keyMapper,
            Function<T, ToNode> valueMapper
    ); @Override boolean equals(Object other); @Override int hashCode(); @Override Builder toBuilder();  }