private String convertLastSeqObj ( Object lastSeqObj ) throws Exception { if ( null == lastSeqObj ) { return null ; } else if ( lastSeqObj instanceof String ) { return ( String ) lastSeqObj ; } else if ( lastSeqObj instanceof Number ) { // Convert to string return "" + lastSeqObj ; } else { throw new Exception ( "Do not know how to handle parameter 'last_seq' in change feed: " + lastSeqObj . getClass ( ) ) ; } }
Converts the object last_seq found in the change feed to a String . In CouchDB 1 . x last_seq is an integer . In CouchDB 2 . x last_seq is a string .