private Response serveOneOrAll ( List < water . ModelMetrics > list ) { JsonArray metricsArray = new JsonArray ( ) ; for ( water . ModelMetrics metrics : list ) { JsonObject metricsJson = metrics . toJSON ( ) ; metricsArray . add ( metricsJson ) ; } JsonObject result = new JsonObject ( ) ; result . add ( "metrics" , metricsArray ) ; return Response . done ( result ) ; }
For one or more water . ModelMetrics from the KV store return Response containing a map of them .