com.atlassian.jira.util.json.JSONObject.optBoolean()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(116)

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

JSONObject.optBoolean介绍

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

代码示例

代码示例来源:origin: com.atlassian.jira/jira-api

/**
 * Get an optional boolean associated with a key.
 * It returns false if there is no such key, or if the value is not
 * Boolean.TRUE or the String "true".
 *
 * @param key A key string.
 * @return The truth.
 */
public boolean optBoolean(final String key)
{
  return optBoolean(key, false);
}

代码示例来源:origin: com.marvelution.jira.plugins/jira-jenkins-plugin

job.setDisplayName(optJsonString(json, "displayName"));
job.setDescription(optJsonString(json, "description"));
job.setBuildable(json.optBoolean("buildable", true));
job.setInQueue(json.optBoolean("inQueue"));
final JSONObject firstBuild = json.optJSONObject("firstBuild");
if (firstBuild != null && firstBuild.has("number")) {

代码示例来源:origin: com.atlassian.jira.plugins/jira-dvcs-connector-api

deserialized.repository = repositoryService.get(jsoned.optInt("repository"));
deserialized.softSync = jsoned.optBoolean("softSync");
deserialized.webHookSync = jsoned.optBoolean("webHookSync");

相关文章