com.eclipsesource.json.Json.value()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中com.eclipsesource.json.Json.value()方法的一些代码示例,展示了Json.value()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Json.value()方法的具体详情如下:
包路径:com.eclipsesource.json.Json
类名称:Json
方法名:value

Json.value介绍

[英]Returns a JsonValue instance that represents the given double value.
[中]返回表示给定double值的JsonValue实例。

代码示例

代码示例来源:origin: ralfstx/minimal-json

/**
 * Appends the JSON representation of the specified string to the end of this array.
 *
 * @param value
 *          the string to add to the array
 * @return the array itself, to enable method chaining
 */
public JsonArray add(String value) {
 values.add(Json.value(value));
 return this;
}

代码示例来源:origin: ralfstx/minimal-json

/**
 * Returns a JsonValue instance that represents the given string.
 *
 * @param string
 *          the string to get a JSON representation for
 * @return a JSON value that represents the given string
 * @deprecated Use <code>Json.value()</code> instead
 */
@Deprecated
public static JsonValue valueOf(String string) {
 return Json.value(string);
}

代码示例来源:origin: ralfstx/minimal-json

/**
 * Returns a JsonValue instance that represents the given <code>boolean</code> value.
 *
 * @param value
 *          the value to get a JSON representation for
 * @return a JSON value that represents the given value
 * @deprecated Use <code>Json.value()</code> instead
 */
@Deprecated
public static JsonValue valueOf(boolean value) {
 return Json.value(value);
}

代码示例来源:origin: ralfstx/minimal-json

/**
 * Appends the JSON representation of the specified <code>float</code> value to the end of this
 * array.
 *
 * @param value
 *          the value to add to the array
 * @return the array itself, to enable method chaining
 */
public JsonArray add(float value) {
 values.add(Json.value(value));
 return this;
}

代码示例来源:origin: ralfstx/minimal-json

/**
 * Appends the JSON representation of the specified <code>double</code> value to the end of this
 * array.
 *
 * @param value
 *          the value to add to the array
 * @return the array itself, to enable method chaining
 */
public JsonArray add(double value) {
 values.add(Json.value(value));
 return this;
}

代码示例来源:origin: ralfstx/minimal-json

/**
 * Returns a JsonValue instance that represents the given <code>int</code> value.
 *
 * @param value
 *          the value to get a JSON representation for
 * @return a JSON value that represents the given value
 * @deprecated Use <code>Json.value()</code> instead
 */
@Deprecated
public static JsonValue valueOf(int value) {
 return Json.value(value);
}

代码示例来源:origin: ralfstx/minimal-json

/**
 * Returns a JsonValue instance that represents the given <code>float</code> value.
 *
 * @param value
 *          the value to get a JSON representation for
 * @return a JSON value that represents the given value
 * @deprecated Use <code>Json.value()</code> instead
 */
@Deprecated
public static JsonValue valueOf(float value) {
 return Json.value(value);
}

代码示例来源:origin: ralfstx/minimal-json

/**
 * Appends the JSON representation of the specified <code>long</code> value to the end of this
 * array.
 *
 * @param value
 *          the value to add to the array
 * @return the array itself, to enable method chaining
 */
public JsonArray add(long value) {
 values.add(Json.value(value));
 return this;
}

代码示例来源:origin: ralfstx/minimal-json

/**
 * Appends the JSON representation of the specified <code>boolean</code> value to the end of this
 * array.
 *
 * @param value
 *          the value to add to the array
 * @return the array itself, to enable method chaining
 */
public JsonArray add(boolean value) {
 values.add(Json.value(value));
 return this;
}

代码示例来源:origin: ralfstx/minimal-json

/**
 * Returns a JsonValue instance that represents the given <code>long</code> value.
 *
 * @param value
 *          the value to get a JSON representation for
 * @return a JSON value that represents the given value
 * @deprecated Use <code>Json.value()</code> instead
 */
@Deprecated
public static JsonValue valueOf(long value) {
 return Json.value(value);
}

代码示例来源:origin: ralfstx/minimal-json

/**
 * Returns a JsonValue instance that represents the given <code>double</code> value.
 *
 * @param value
 *          the value to get a JSON representation for
 * @return a JSON value that represents the given value
 * @deprecated Use <code>Json.value()</code> instead
 */
@Deprecated
public static JsonValue valueOf(double value) {
 return Json.value(value);
}

代码示例来源:origin: ralfstx/minimal-json

/**
 * Appends the JSON representation of the specified <code>int</code> value to the end of this
 * array.
 *
 * @param value
 *          the value to add to the array
 * @return the array itself, to enable method chaining
 */
public JsonArray add(int value) {
 values.add(Json.value(value));
 return this;
}

代码示例来源:origin: ralfstx/minimal-json

/**
 * Replaces the element at the specified position in this array with the JSON representation of
 * the specified string.
 *
 * @param index
 *          the index of the array element to replace
 * @param value
 *          the string to be stored at the specified array position
 * @return the array itself, to enable method chaining
 * @throws IndexOutOfBoundsException
 *           if the index is out of range, i.e. <code>index &lt; 0</code> or
 *           <code>index &gt;= size</code>
 */
public JsonArray set(int index, String value) {
 values.set(index, Json.value(value));
 return this;
}

代码示例来源:origin: ralfstx/minimal-json

/**
 * Replaces the element at the specified position in this array with the JSON representation of
 * the specified <code>double</code> value.
 *
 * @param index
 *          the index of the array element to replace
 * @param value
 *          the value to be stored at the specified array position
 * @return the array itself, to enable method chaining
 * @throws IndexOutOfBoundsException
 *           if the index is out of range, i.e. <code>index &lt; 0</code> or
 *           <code>index &gt;= size</code>
 */
public JsonArray set(int index, double value) {
 values.set(index, Json.value(value));
 return this;
}

代码示例来源:origin: ralfstx/minimal-json

/**
 * Replaces the element at the specified position in this array with the JSON representation of
 * the specified <code>int</code> value.
 *
 * @param index
 *          the index of the array element to replace
 * @param value
 *          the value to be stored at the specified array position
 * @return the array itself, to enable method chaining
 * @throws IndexOutOfBoundsException
 *           if the index is out of range, i.e. <code>index &lt; 0</code> or
 *           <code>index &gt;= size</code>
 */
public JsonArray set(int index, int value) {
 values.set(index, Json.value(value));
 return this;
}

代码示例来源:origin: ralfstx/minimal-json

/**
 * Replaces the element at the specified position in this array with the JSON representation of
 * the specified <code>long</code> value.
 *
 * @param index
 *          the index of the array element to replace
 * @param value
 *          the value to be stored at the specified array position
 * @return the array itself, to enable method chaining
 * @throws IndexOutOfBoundsException
 *           if the index is out of range, i.e. <code>index &lt; 0</code> or
 *           <code>index &gt;= size</code>
 */
public JsonArray set(int index, long value) {
 values.set(index, Json.value(value));
 return this;
}

代码示例来源:origin: ralfstx/minimal-json

/**
 * Replaces the element at the specified position in this array with the JSON representation of
 * the specified <code>boolean</code> value.
 *
 * @param index
 *          the index of the array element to replace
 * @param value
 *          the value to be stored at the specified array position
 * @return the array itself, to enable method chaining
 * @throws IndexOutOfBoundsException
 *           if the index is out of range, i.e. <code>index &lt; 0</code> or
 *           <code>index &gt;= size</code>
 */
public JsonArray set(int index, boolean value) {
 values.set(index, Json.value(value));
 return this;
}

代码示例来源:origin: ralfstx/minimal-json

public void timeValueOfLong(int reps) {
 for (int i = 0; i < reps; i++) {
  checkValue(Json.value(23l));
 }
}

代码示例来源:origin: ralfstx/minimal-json

public void timeValueOfInt(int reps) {
 for (int i = 0; i < reps; i++) {
  checkValue(Json.value(23));
 }
}

代码示例来源:origin: ralfstx/minimal-json

private static JsonValue extractSimpleName(JsonObject caliperResults) {
 String name = caliperResults.get("run").asObject().get("benchmarkName").asString();
 return Json.value(name.replaceFirst(".*\\.", ""));
}

相关文章

微信公众号

最新文章

更多