本文整理了Java中org.codehaus.jackson.JsonNode.getLongValue()
方法的一些代码示例,展示了JsonNode.getLongValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonNode.getLongValue()
方法的具体详情如下:
包路径:org.codehaus.jackson.JsonNode
类名称:JsonNode
方法名:getLongValue
暂无
代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl
@Override
public long getLongValue() throws IOException, JsonParseException {
return currentNumericNode().getLongValue();
}
代码示例来源:origin: linkedin/parseq
private static long getLongField(final JsonNode node, final String fieldName) throws IOException {
return getField(node, fieldName).getLongValue();
}
代码示例来源:origin: neo4j/neo4j
JsonNode everything = jsonNode( response.rawContent() );
JsonNode result = everything.get( "results" ).get( 0 );
long id = result.get( "data" ).get( 0 ).get( "row" ).get( 0 ).getLongValue();
代码示例来源:origin: org.apache.avro/avro
if (!n.isNumber())
throw new AvroTypeException("Non-numeric default value for long: "+n);
e.writeLong(n.getLongValue());
break;
case FLOAT:
代码示例来源:origin: camunda/camunda-bpm-platform
@Override
public long getLongValue() throws IOException, JsonParseException {
return currentNumericNode().getLongValue();
}
代码示例来源:origin: org.apache.avro/avro
case VALUE_NUMBER_INT:
out.writeIndex(JsonType.LONG.ordinal());
out.writeLong(node.getLongValue());
break;
case VALUE_NUMBER_FLOAT:
代码示例来源:origin: com.atlassian.jira/jira-core
public long getLongValue()
{
return delegate.getLongValue();
}
代码示例来源:origin: klout/brickhouse
return jsonNode.toString();
case LONG:
return jsonNode.getLongValue();
case SHORT:
return (short) jsonNode.getIntValue();
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.clients
/**
* Executes a query on the server and returns only the number of rows in the result
*
* @param query query to be executed
* @param type type of the query
* @return total results returned by the query
* @throws ClientException if the request failed to execute
* @throws InterruptedException to mark that this method blocks
*/
public long doCount(final String query, final QueryType type) throws ClientException, InterruptedException {
return doQuery(query, type, false, false).get("total").getLongValue();
}
代码示例来源:origin: apache/incubator-sentry
private Long getLongField(final JsonNode pNode, final String pFieldName) {
Preconditions.checkNotNull(pNode);
Preconditions.checkNotNull(pFieldName);
return pNode.get(pFieldName) != null && pNode.get(pFieldName).isLong() ? pNode.get(pFieldName).getLongValue()
: null;
}
代码示例来源:origin: apache/sentry
private Long getLongField(final JsonNode pNode, final String pFieldName) {
Preconditions.checkNotNull(pNode);
Preconditions.checkNotNull(pFieldName);
return pNode.get(pFieldName) != null && pNode.get(pFieldName).isLong() ? pNode.get(pFieldName).getLongValue()
: null;
}
代码示例来源:origin: org.codehaus.jackson/jackson-mapper-lgpl
@Override
public long getLongValue() throws IOException, JsonParseException {
return currentNumericNode().getLongValue();
}
代码示例来源:origin: NGDATA/lilyproject
public static Long getLong(JsonNode node, String prop, Long defaultValue) throws JsonFormatException {
if (node.get(prop) == null) {
return defaultValue;
}
if (!node.get(prop).isLong() && !node.get(prop).isInt()) {
throw new JsonFormatException("Not an long property: " + prop);
}
return node.get(prop).getLongValue();
}
代码示例来源:origin: NGDATA/hbase-indexer
public static Long getLong(JsonNode node, String prop, Long defaultValue) throws JsonFormatException {
if (node.get(prop) == null) {
return defaultValue;
}
if (!node.get(prop).isLong() && !node.get(prop).isInt()) {
throw new JsonFormatException("Not an long property: " + prop);
}
return node.get(prop).getLongValue();
}
代码示例来源:origin: com.ngdata/hbase-indexer-common
public static Long getLong(JsonNode node, String prop, Long defaultValue) throws JsonFormatException {
if (node.get(prop) == null || node.get(prop).isNull()) {
return defaultValue;
}
if (!node.get(prop).isLong() && !node.get(prop).isInt()) {
throw new JsonFormatException("Not an long property: " + prop);
}
return node.get(prop).getLongValue();
}
代码示例来源:origin: NGDATA/hbase-indexer
public static long getLong(JsonNode node, String prop) throws JsonFormatException {
if (node.get(prop) == null) {
throw new JsonFormatException("Missing required property: " + prop);
}
if (!node.get(prop).isLong() && !node.get(prop).isInt()) {
throw new JsonFormatException("Not an long property: " + prop);
}
return node.get(prop).getLongValue();
}
代码示例来源:origin: NGDATA/lilyproject
public static long getLong(JsonNode node, String prop) throws JsonFormatException {
if (node.get(prop) == null) {
throw new JsonFormatException("Missing required property: " + prop);
}
if (!node.get(prop).isLong() && !node.get(prop).isInt()) {
throw new JsonFormatException("Not an long property: " + prop);
}
return node.get(prop).getLongValue();
}
代码示例来源:origin: com.ngdata/hbase-indexer-common
public static long getLong(JsonNode node, String prop) throws JsonFormatException {
if (node.get(prop) == null || node.get(prop).isNull()) {
throw new JsonFormatException("Missing required property: " + prop);
}
if (!node.get(prop).isLong() && !node.get(prop).isInt()) {
throw new JsonFormatException("Not an long property: " + prop);
}
return node.get(prop).getLongValue();
}
代码示例来源:origin: org.apache.isis.viewer/json-applib
private Long getLong(final String path, final JsonNode node) {
if (representsNull(node)) {
return null;
}
checkValue(path, node, "a long");
if (!node.isLong()) {
throw new IllegalArgumentException(formatExMsg(path, "is not a long"));
}
return node.getLongValue();
}
代码示例来源:origin: eBay/YiDB
@Override
public Object read(IEntity curEntity, Object valueNode, MetaField metaField) {
CheckConditions.checkNotNull(metaField);
CheckConditions.checkNotNull(valueNode, "Faild to read Long from %s",metaField.getName());
JsonNode jsonNode = (JsonNode)valueNode;
if (jsonNode.isNull()) {
return null;
}
CheckConditions.checkArgument(jsonNode.isInt() || jsonNode.isLong(), "Field '%s' should be long. But the value is %s",
metaField.getName(), jsonNode);
return jsonNode.getLongValue();
}
内容来源于网络,如有侵权,请联系作者删除!