@Override public int getIntValue() throws IOException, JsonParseException { return currentNumericNode().getIntValue(); }
private static int getIntField(final JsonNode node, final String fieldName) throws IOException { return getField(node, fieldName).getIntValue(); }
private List<FileData> recursiveShallowExport(List<FileData> files, CTLSchemaDto parent) throws Exception { files.add(this.shallowExport(parent)); ObjectNode object = new ObjectMapper().readValue(parent.getBody(), ObjectNode.class); ArrayNode dependencies = (ArrayNode) object.get(DEPENDENCIES); if (dependencies != null) { for (JsonNode node : dependencies) { ObjectNode dependency = (ObjectNode) node; String fqn = dependency.get(FQN).getTextValue(); Integer version = dependency.get(VERSION).getIntValue(); CTLSchemaDto child = this.findAnyCtlSchemaByFqnAndVerAndTenantIdAndApplicationId( fqn, version, parent.getMetaInfo().getTenantId(), parent.getMetaInfo().getApplicationId()); Validate.notNull(child, MessageFormat.format("The dependency [{0}] was not found!", fqn)); this.recursiveShallowExport(files, child); } } return files; } }
int scale = 0; try { precision = schema.getJsonProp(AvroSerDe.AVRO_PROP_PRECISION).getIntValue(); scale = schema.getJsonProp(AvroSerDe.AVRO_PROP_SCALE).getIntValue(); } catch (Exception ex) { throw new AvroSerdeException("Failed to obtain scale value from file schema: " + schema, ex);
if (sizeNode == null || !sizeNode.isInt()) throw new SchemaParseException("Invalid or no size: "+schema); result = new FixedSchema(name, doc, sizeNode.getIntValue()); if (name != null) names.add(result); } else
if (!n.isNumber()) throw new AvroTypeException("Non-numeric default value for int: "+n); e.writeInt(n.getIntValue()); break; case LONG:
@Override public int getIntValue() throws IOException, JsonParseException { return currentNumericNode().getIntValue(); }
private List<Line> parseLines(JsonNode node){ JsonNode lineNodes=node.get("lines"); if(lineNodes==null){ return null; } List<Line> lines=new ArrayList<Line>(); Iterator<JsonNode> iter=lineNodes.iterator(); while(iter.hasNext()){ JsonNode jsonNode=iter.next(); Line line=new Line(); line.setFromNodeId(jsonNode.get("fromNodeId").getIntValue()); line.setToNodeId(jsonNode.get("toNodeId").getIntValue()); lines.add(line); } return lines; }
return jsonNode.getLongValue(); case SHORT: return (short) jsonNode.getIntValue(); case BYTE: return (byte) jsonNode.getIntValue(); case BINARY: try { return jsonNode.getIntValue(); case FLOAT: return new Float(jsonNode.getDoubleValue());
while(childrenNodesIter.hasNext()){ JsonNode childNode=childrenNodesIter.next(); int id=childNode.get("id").getIntValue(); JsonNode nodeTypeNode = childNode.get("nodeType"); if(nodeTypeNode==null){ AndNode node=(AndNode)reteNode; node.setId(id); node.setToLineCount(childNode.get("toLineCount").getIntValue()); node.setLines(parseLines(childNode)); }else if(reteNode instanceof OrNode){
item.setScript(itemNode.get("script").getTextValue()); }else{ item.setPercent(itemNode.get("percent").getIntValue());
/** * @return the service identifier */ public int getId() { return service.get("id").getIntValue(); }
public static int getInt(JsonNode node, String prop, int defaultValue) throws JsonFormatException { if (node.get(prop) == null) { return defaultValue; } if (!node.get(prop).isInt()) { throw new JsonFormatException("Not an integer property: " + prop); } return node.get(prop).getIntValue(); }
public static int getInt(JsonNode node, String prop) throws JsonFormatException { if (node.get(prop) == null) { throw new JsonFormatException("Missing required property: " + prop); } if (!node.get(prop).isInt()) { throw new JsonFormatException("Not an integer property: " + prop); } return node.get(prop).getIntValue(); }
public static int getInt(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).isInt()) { throw new JsonFormatException("Not an integer property: " + prop); } return node.get(prop).getIntValue(); }
@Override public Partition deserialize(JsonParser jsonParser, DeserializationContext context) throws IOException, JsonProcessingException { ObjectCodec oc = jsonParser.getCodec(); JsonNode node = oc.readTree(jsonParser); return new Partition(node.getIntValue()); } }
@Override public SystemStreamPartition deserialize(JsonParser jsonParser, DeserializationContext context) throws IOException, JsonProcessingException { ObjectCodec oc = jsonParser.getCodec(); JsonNode node = oc.readTree(jsonParser); String system = node.get("system").getTextValue(); String stream = node.get("stream").getTextValue(); Partition partition = new Partition(node.get("partition").getIntValue()); return new SystemStreamPartition(system, stream, partition); } }
@Override public SystemStreamPartition deserialize(JsonParser jsonParser, DeserializationContext context) throws IOException, JsonProcessingException { ObjectCodec oc = jsonParser.getCodec(); JsonNode node = oc.readTree(jsonParser); String system = node.get("system").getTextValue(); String stream = node.get("stream").getTextValue(); Partition partition = new Partition(node.get("partition").getIntValue()); return new SystemStreamPartition(system, stream, partition); } }
@Override public Partition deserialize(JsonParser jsonParser, DeserializationContext context) throws IOException, JsonProcessingException { ObjectCodec oc = jsonParser.getCodec(); JsonNode node = oc.readTree(jsonParser); return new Partition(node.getIntValue()); } }
@Override public SystemStreamPartition deserialize(JsonParser jsonParser, DeserializationContext context) throws IOException, JsonProcessingException { ObjectCodec oc = jsonParser.getCodec(); JsonNode node = oc.readTree(jsonParser); String system = node.get("system").getTextValue(); String stream = node.get("stream").getTextValue(); Partition partition = new Partition(node.get("partition").getIntValue()); return new SystemStreamPartition(system, stream, partition); } }