[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/APIJSON/APIJSON/main/src/main/java/apijson/JSONRequest.java [Back]  [Original]

/*Copyright (C) 2026 the APIJSON group. All rights reserved. This source code is licensed under the Apache License Version 2.0.*/ package apijson; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import static apijson.StringUtil.PATTERN_ALPHA_BIG; /**wrapper for request * @author Lemon * @see #puts * @see #toArray * @use JSONRequest request = JSON.createJSONObject(...); *
request.puts(...);//not a must *
request.toArray(...);//not a must */ public interface JSONRequest extends JSONMap { //default JSONRequest() { // super(); //} ///** // * @param object must be annotated by {@link MethodAccess} // * @see {@link #JSONRequest(String, Object)} // */ //default JSONRequest(Object object) { // this(null, object); //} ///** // * @param name // * @param object // * @see {@link #puts(String, Object)} // */ //default JSONRequest(String name, Object object) { // this(); // puts(name, object); //} //public static JSONRequest valueOf(Object obj) { // JSONRequest req = new JSONRequest() {}; // Map m = JSON.parseObject(obj); // if (m != null && ! m.isEmpty()) { // req.map.putAll(m); // } // return req; //} public static final String KEY_TAG = "tag";//JSONRequest public static final String KEY_VERSION = "version";//JSONRequest public static final String KEY_FORMAT = "format";//JSONRequest /**set "tag":tag in outermost layer * for write operations * @param tag * @return */ default JSONRequest setTag(String tag) { return puts(KEY_TAG, tag); } /**set "version":version in outermost layer * for target version of request * @param version * @return */ default JSONRequest setVersion(Integer version) { return puts(KEY_VERSION, version); } /**set "format":format in outermost layer * for format APIJSON special keys to normal keys of response * @param format * @return */ default JSONRequest setFormat(Boolean format) { return puts(KEY_FORMAT, format); } //array object
Web Proxy Viewer  |  New URL  |  Original Page