private List < String > hashtagsFromArray ( JSONObject json , String array ) { if ( json . containsKey ( array ) ) { JSONArray hashtagsArray = json . getJSONArray ( array ) ; List < String > result = new ArrayList < String > ( hashtagsArray . size ( ) ) ; for ( Object tag : hashtagsArray ) { result . add ( tag . toString ( ) ) ; } return result ; } return Collections . emptyList ( ) ; }
Converts an array key from JSON into a list of the strings it contains .