protected long getRevisionIdFromResponse ( JsonNode response ) throws JsonMappingException { if ( response == null ) { throw new JsonMappingException ( "API response is null" ) ; } JsonNode entity = null ; if ( response . has ( "entity" ) ) { entity = response . path ( "entity" ) ; } else if ( response . has ( "pageinfo" ) ) { entity = response . path ( "pageinfo" ) ; } if ( entity != null && entity . has ( "lastrevid" ) ) { return entity . path ( "lastrevid" ) . asLong ( ) ; } throw new JsonMappingException ( "The last revision id could not be found in API response" ) ; }
Extracts the last revision id from the JSON response returned by the API after an edit