use of org.opendatakit.briefcase.reused.Iso8601Helpers in project briefcase by opendatakit.
the class AggregateCursor method from.
/**
* Parses the provided cursor xml document and returns a new Cursor instance.
*/
public static Cursor from(String cursorXml) {
if (cursorXml.isEmpty() || // Ona compatibility
cursorXml.equals("0"))
return AggregateCursor.empty();
XmlElement root = XmlElement.from(cursorXml);
Optional<OffsetDateTime> lastUpdate = root.findElement("attributeValue").flatMap(XmlElement::maybeValue).map(Iso8601Helpers::parseDateTime);
Optional<String> lastReturnedValue = root.findElement("uriLastReturnedValue").flatMap(XmlElement::maybeValue);
return new AggregateCursor(cursorXml, lastUpdate, lastReturnedValue);
}
Aggregations