@Override public long getLongValue() throws IOException, JsonParseException { return currentNumericNode().getLongValue(); }
private static long getLongField(final JsonNode node, final String fieldName) throws IOException { return getField(node, fieldName).getLongValue(); }
JsonNode everything = jsonNode( response.rawContent() ); JsonNode result = everything.get( "results" ).get( 0 ); long id = result.get( "data" ).get( 0 ).get( "row" ).get( 0 ).getLongValue();
if (!n.isNumber()) throw new AvroTypeException("Non-numeric default value for long: "+n); e.writeLong(n.getLongValue()); break; case FLOAT:
@Override public long getLongValue() throws IOException, JsonParseException { return currentNumericNode().getLongValue(); }
case VALUE_NUMBER_INT: out.writeIndex(JsonType.LONG.ordinal()); out.writeLong(node.getLongValue()); break; case VALUE_NUMBER_FLOAT:
public long getLongValue() { return delegate.getLongValue(); }
return jsonNode.toString(); case LONG: return jsonNode.getLongValue(); case SHORT: return (short) jsonNode.getIntValue();
/** * 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(); }
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; }
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; }
@Override public long getLongValue() throws IOException, JsonParseException { return currentNumericNode().getLongValue(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
@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(); }