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

io.github.wycst.wast.json.JSONValue Maven / Gradle / Ivy

Go to download

Wast is a high-performance Java toolset library package that includes JSON, YAML, CSV, HttpClient, JDBC and EL engines

There is a newer version: 0.0.16
Show newest version
package io.github.wycst.wast.json;

import java.util.List;
import java.util.Map;

/**
 * JSON字符串中value可选类型约定为6种: String, Number, boolean, Map, List,null, 除了null外都可以使用valueOf进行显示类型的构造;
 *
 * @Date 2024/8/2 23:46
 * @Created by wangyc
 */
public final class JSONValue {

    final T value;

    JSONValue(T value) {
        this.value = value;
    }

    public T get() {
        return value;
    }

    public static JSONValue of(boolean value) {
        return new JSONValue(value);
    }

    public static JSONValue of(Number value) {
        return new JSONValue(value);
    }

    public static JSONValue of(String value) {
        return new JSONValue(value);
    }

    public static JSONValue of(Map value) {
        return new JSONValue(value);
    }

    public static JSONValue of(List value) {
        return new JSONValue(value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy