All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.nemerosa.ontrack.json.ArrayBuilder Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
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