public static List < MailboxNodeContent > parseMailboxContents ( List < String > jsons ) throws JSONException { ArrayList < MailboxNodeContent > objects = new ArrayList < MailboxNodeContent > ( jsons . size ( ) ) ; for ( String json : jsons ) { MailboxNodeContent content = null ; JSONObject jsObj = new JSONObject ( json ) ; long HSId = jsObj . getLong ( "HSId" ) ; Integer partitionId = null ; if ( jsObj . has ( "partitionId" ) ) { partitionId = jsObj . getInt ( "partitionId" ) ; } content = new MailboxNodeContent ( HSId , partitionId ) ; objects . add ( content ) ; } return objects ; }
Helper method for parsing mailbox node contents into Java objects .