net.nemerosa.ontrack.json.ArrayBuilder Maven / Gradle / Ivy
package net.nemerosa.ontrack.json;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
public class ArrayBuilder implements JsonBuilder {
private final JsonNodeFactory factory;
private final ArrayNode thisNode;
public ArrayBuilder(JsonNodeFactory factory) {
this.factory = factory;
this.thisNode = this.factory.arrayNode();
}
public ArrayBuilder with(JsonNode node) {
thisNode.add(node);
return this;
}
@Override
public ArrayNode end() {
return thisNode;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy