Parses a last data point query @return A LastPointQuery to work with @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed
()
| 287 | * @throws BadRequestException if the content was missing or parsing failed |
| 288 | */ |
| 289 | public LastPointQuery parseLastPointQueryV1() { |
| 290 | final String json = query.getContent(); |
| 291 | if (json == null || json.isEmpty()) { |
| 292 | throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, |
| 293 | "Missing message content", |
| 294 | "Supply valid JSON formatted data in the body of your request"); |
| 295 | } |
| 296 | try { |
| 297 | return JSON.parseToObject(json, LastPointQuery.class); |
| 298 | } catch (IllegalArgumentException iae) { |
| 299 | throw new BadRequestException("Unable to parse the given JSON", iae); |
| 300 | } |
| 301 | } |
| 302 | |
| 303 | /** |
| 304 | * Parses a single UIDMeta object |
nothing calls this directly
no test coverage detected