public static String formatResponse ( Response response ) { if ( response == null ) { return "" ; } StringBuilder output = new StringBuilder ( ) ; if ( response . isData ( ) ) { output . append ( DIV_I ) ; Gson gson = new GsonBuilder ( ) . setPrettyPrinting ( ) . create ( ) ; if ( response . getArrayData ( ) != null ) { output . append ( gson . toJson ( response . getArrayData ( ) ) ) ; } if ( response . getObjectData ( ) != null ) { output . append ( gson . toJson ( response . getObjectData ( ) ) ) ; } output . append ( END_IDIV ) ; } return formatHTML ( output . toString ( ) ) ; }
Formats the response parameters to be prettily printed out in HTML