public static IoTFieldsExtension buildFor(int seqNr, boolean done, NodeInfo nodeInfo, List<? extends IoTDataField> data) { TimestampElement timestampElement = new TimestampElement(new Date(), data); NodeElement nodeElement = new NodeElement(nodeInfo, timestampElement); return new IoTFieldsExtension(seqNr, done, nodeElement); }
public NodeElement parseNode(XmlPullParser parser) throws XmlPullParserException, IOException, ParseException { final int initialDepth = parser.getDepth(); final NodeInfo nodeInfo = NodeInfoParser.parse(parser); List<TimestampElement> timestampElements = new ArrayList<>(); outerloop: while (true) { final int eventType = parser.next(); final String name = parser.getName(); switch (eventType) { case XmlPullParser.START_TAG: switch (name){ case TimestampElement.ELEMENT: TimestampElement timestampElement = parseTimestampElement(parser); timestampElements.add(timestampElement); break; } break; case XmlPullParser.END_TAG: if (parser.getDepth() == initialDepth) { break outerloop; } break; } } return new NodeElement(nodeInfo, timestampElements); }
public static IoTFieldsExtension buildFor(int seqNr, boolean done, NodeInfo nodeInfo, List<? extends IoTDataField> data) { TimestampElement timestampElement = new TimestampElement(new Date(), data); NodeElement nodeElement = new NodeElement(nodeInfo, timestampElement); return new IoTFieldsExtension(seqNr, done, nodeElement); }
public NodeElement parseNode(XmlPullParser parser) throws XmlPullParserException, IOException, ParseException { final int initialDepth = parser.getDepth(); final NodeInfo nodeInfo = NodeInfoParser.parse(parser); List<TimestampElement> timestampElements = new ArrayList<>(); outerloop: while (true) { final int eventType = parser.next(); final String name = parser.getName(); switch (eventType) { case XmlPullParser.START_TAG: switch (name){ case TimestampElement.ELEMENT: TimestampElement timestampElement = parseTimestampElement(parser); timestampElements.add(timestampElement); break; } break; case XmlPullParser.END_TAG: if (parser.getDepth() == initialDepth) { break outerloop; } break; } } return new NodeElement(nodeInfo, timestampElements); }