io.github.wycst.wast.json.JSONValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wast Show documentation
Show all versions of wast Show documentation
Wast is a high-performance Java toolset library package that includes JSON, YAML, CSV, HttpClient, JDBC and EL engines
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