org.codehaus.jettison.json.JSONArray.optBoolean()方法的使用及代码示例

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

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

JSONArray.optBoolean介绍

[英]Get the optional boolean value associated with an index. It returns false if there is no value at that index, or if the value is not Boolean.TRUE or the String "true".
[中]获取与索引关联的可选布尔值。如果该索引处没有值,或者该值不是布尔值,则返回false。TRUE或字符串“TRUE”。

代码示例

代码示例来源:origin: org.codehaus.jettison/jettison

/**
 * Get the optional boolean value associated with an index.
 * It returns false if there is no value at that index,
 * or if the value is not Boolean.TRUE or the String "true".
 *
 * @param index The index must be between 0 and length() - 1.
 * @return      The truth.
 */
public boolean optBoolean(int index)  {
  return optBoolean(index, false);
}

代码示例来源:origin: org.codehaus.jettison/com.springsource.org.codehaus.jettison

/**
 * Get the optional boolean value associated with an index.
 * It returns false if there is no value at that index,
 * or if the value is not Boolean.TRUE or the String "true".
 *
 * @param index The index must be between 0 and length() - 1.
 * @return      The truth.
 */
public boolean optBoolean(int index)  {
  return optBoolean(index, false);
}

相关文章