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

org.davidmoten.kool.json.LazyObjectNode Maven / Gradle / Ivy

There is a newer version: 0.1.36
Show newest version
package org.davidmoten.kool.json;


import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.function.Supplier;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.node.ObjectNode;

public final class LazyObjectNode implements Supplier {

    private final JsonParser p;

    LazyObjectNode(JsonParser p) {
        this.p = p;
    }

    @Override
    public ObjectNode get() {
        try {
            return (ObjectNode) Util.MAPPER.readTree(p);
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy