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

org.duckdb.JsonNode Maven / Gradle / Ivy

There is a newer version: 1.1.3
Show newest version
package org.duckdb;

/**
 * Basic wrapper for the JSON type - modelled after the jackson databind JsonNode
 */
public class JsonNode {
    private final String source;
    public JsonNode(String source) {
        this.source = source;
    }
    public boolean isArray() {
        return source.charAt(0) == '[';
    }
    public boolean isObject() {
        return source.charAt(0) == '{';
    }
    public boolean isBoolean() {
        return source == "true" || source == "false";
    }
    public boolean isNull() {
        return source == "null";
    }
    public boolean isNumber() {
        return Character.isDigit(source.charAt(0));
    }
    public boolean isString() {
        return !(isObject() || isBoolean() || isNull() || isArray() || isNumber());
    }
    public String toString() {
        return source;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy