Skip to content

Commit

Permalink
ObjectNode does not implement Iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-krecan committed Jul 17, 2024
1 parent 14add68 commit 5cb8af7
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.jetbrains.annotations.NotNull;

class GenericNodeBuilder implements NodeBuilder {
private static final GenericNodeBuilder INSTANCE = new GenericNodeBuilder();
Expand Down Expand Up @@ -276,7 +275,7 @@ public String toString() {
}
}

static final class ObjectNode extends NodeSkeleton implements Iterable<Node.KeyValue> {
static final class ObjectNode extends NodeSkeleton {
private final Map<String, Object> jsonObject;
private final NodeBuilder nodeBuilder;

Expand Down Expand Up @@ -317,11 +316,6 @@ public boolean isObject() {
return true;
}

@Override
public @NotNull Iterator<KeyValue> iterator() {
return fields();
}

@Override
public Node get(String key) {
if (jsonObject.containsKey(key)) {
Expand All @@ -344,7 +338,7 @@ public NodeType getNodeType() {
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("{");
Iterator<Node.KeyValue> entries = this.iterator();
Iterator<Node.KeyValue> entries = this.fields();
while (entries.hasNext()) {
Node.KeyValue entry = entries.next();
builder.append('"')
Expand Down

0 comments on commit 5cb8af7

Please sign in to comment.