org.codehaus.jackson.JsonNode.getBooleanValue()方法的使用及代码示例

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

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

JsonNode.getBooleanValue介绍

[英]Method to use for accessing JSON boolean values (value literals 'true' and 'false'). For other types, always returns false.
[中]用于访问JSON布尔值(值文本“true”和“false”)的方法。对于其他类型,始终返回false。

代码示例

代码示例来源:origin: linkedin/parseq

private static boolean getBooleanField(final JsonNode node, final String fieldName) throws IOException {
 return getField(node, fieldName).getBooleanValue();
}

代码示例来源:origin: org.apache.avro/avro

if (!oneWayNode.isBoolean())
 throw new SchemaParseException("one-way must be boolean: "+json);
oneWay = oneWayNode.getBooleanValue();

代码示例来源:origin: soabase/exhibitor

return new ServerStatus(spec.getHostname(), code, description, value.get("isLeader").getBooleanValue());

代码示例来源:origin: apache/nifi

return fieldNode.getBooleanValue();

代码示例来源:origin: apache/nifi

return fieldNode.getBooleanValue();

代码示例来源:origin: org.apache.avro/avro

if (!n.isBoolean())
  throw new AvroTypeException("Non-boolean default for boolean: "+n);
 e.writeBoolean(n.getBooleanValue());
 break;
case NULL:

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

public boolean getBooleanValue()
{
  return delegate.getBooleanValue();
}

代码示例来源:origin: klout/brickhouse

return jsonNode.getDoubleValue();
case BOOLEAN:
  return jsonNode.getBooleanValue();
case TIMESTAMP:
  long time = isoFormatter.parseMillis(jsonNode.getTextValue());

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.clients

/**
 * Returns the indicator if the bundle is a fragment
 * 
 * @return {@code true} if bundle is a fragment, {@code false} otherwise.
 */
public boolean isFragment() {
  return bundle.get("fragment").getBooleanValue();
}

代码示例来源:origin: NGDATA/lilyproject

public static boolean getBoolean(JsonNode node, String prop, boolean defaultValue) throws JsonFormatException {
  if (node.get(prop) == null) {
    return defaultValue;
  }
  if (!node.get(prop).isBoolean()) {
    throw new JsonFormatException("Not a string property: " + prop);
  }
  return node.get(prop).getBooleanValue();
}

代码示例来源:origin: NGDATA/hbase-indexer

public static Boolean getBoolean(JsonNode node, String prop, boolean defaultValue) throws JsonFormatException {
  if (node.get(prop) == null) {
    return defaultValue;
  }
  if (node.get(prop).isNull()) {
    return null;
  }
  if (!node.get(prop).isBoolean()) {
    throw new JsonFormatException("Not a boolean property: " + prop);
  }
  return node.get(prop).getBooleanValue();
}

代码示例来源:origin: com.ngdata/hbase-indexer-common

public static Boolean getBoolean(JsonNode node, String prop, boolean defaultValue) throws JsonFormatException {
  if (node.get(prop) == null) {
    return defaultValue;
  }
  if (node.get(prop).isNull()) {
    return null;
  }
  if (!node.get(prop).isBoolean()) {
    throw new JsonFormatException("Not a boolean property: " + prop);
  }
  return node.get(prop).getBooleanValue();
}

代码示例来源:origin: com.ngdata/hbase-indexer-common

public static Boolean getBoolean(JsonNode node, String prop) throws JsonFormatException {
  if (node.get(prop) == null) {
    throw new JsonFormatException("Missing required property: " + prop);
  }
  if (node.get(prop).isNull()) {
    return null;
  }
  if (!node.get(prop).isBoolean()) {
    throw new JsonFormatException("Not a boolean property: " + prop);
  }
  return node.get(prop).getBooleanValue();
}

代码示例来源:origin: NGDATA/lilyproject

public static boolean getBoolean(JsonNode node, String prop) throws JsonFormatException {
  if (node.get(prop) == null) {
    throw new JsonFormatException("Missing required property: " + prop);
  }
  if (!node.get(prop).isBoolean()) {
    throw new JsonFormatException("Not a string property: " + prop);
  }
  return node.get(prop).getBooleanValue();
}

代码示例来源:origin: NGDATA/hbase-indexer

public static Boolean getBoolean(JsonNode node, String prop) throws JsonFormatException {
  if (node.get(prop) == null) {
    throw new JsonFormatException("Missing required property: " + prop);
  }
  if (node.get(prop).isNull()) {
    return null;
  }
  if (!node.get(prop).isBoolean()) {
    throw new JsonFormatException("Not a boolean property: " + prop);
  }
  return node.get(prop).getBooleanValue();
}

代码示例来源:origin: oVirt/ovirt-engine

public boolean isLazyLoad() {
  JsonNode target = descriptorNode.path(ATT_LAZYLOAD);
  return !target.isMissingNode() ? target.getBooleanValue() : true;
}

代码示例来源:origin: mobi.boilr/libdynticker

@Override
protected String getTicker(Pair pair) throws IOException {
  // https://coinmate.io/api/ticker?currencyPair=BTC_USD
  JsonNode node = readJsonFromUrl("https://coinmate.io/api/ticker?currencyPair="
    + pair.getCoin() + "_" + pair.getExchange());
  if(node.get("error").getBooleanValue())
    throw new IOException(node.get("errorMessage").asText());
  return parseTicker(node, pair);
}

代码示例来源:origin: org.apache.isis.viewer/isis-viewer-restfulobjects-applib

private Boolean getBoolean(final String path, final JsonNode node) {
  if (representsNull(node)) {
    return null;
  }
  checkValue(path, node, "a boolean");
  if (!node.isBoolean()) {
    throw new IllegalArgumentException(formatExMsg(path, "is not a boolean"));
  }
  return node.getBooleanValue();
}

代码示例来源:origin: org.apache.isis.viewer/json-applib

private Boolean getBoolean(final String path, final JsonNode node) {
  if (representsNull(node)) {
    return null;
  }
  checkValue(path, node, "a boolean");
  if (!node.isBoolean()) {
    throw new IllegalArgumentException(formatExMsg(path, "is not a boolean"));
  }
  return node.getBooleanValue();
}

代码示例来源:origin: apache/sentry

public boolean isActive() {
  JsonNode gauges = getGauges(root);
  JsonNode obj = getValue(gauges.findPath(sentryService + ".is_active"));
  return obj.getBooleanValue();
 }
}

相关文章