MCPcopy Create free account
hub / github.com/OpenTSDB/opentsdb / parseTreeRuleV1

Method parseTreeRuleV1

src/tsd/HttpJsonSerializer.java:410–419  ·  view source on GitHub ↗

Parses a single TreeRule object @return A parsed tree rule @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed

()

Source from the content-addressed store, hash-verified

408 * @throws BadRequestException if the content was missing or parsing failed
409 */
410 public TreeRule parseTreeRuleV1() {
411 final String json = query.getContent();
412 if (json == null || json.isEmpty()) {
413 throw new BadRequestException(HttpResponseStatus.BAD_REQUEST,
414 "Missing message content",
415 "Supply valid JSON formatted data in the body of your request");
416 }
417
418 return JSON.parseToObject(json, TreeRule.class);
419 }
420
421 /**
422 * Parses one or more tree rules

Callers

nothing calls this directly

Calls 3

parseToObjectMethod · 0.95
isEmptyMethod · 0.80
getContentMethod · 0.45

Tested by

no test coverage detected