MCPcopy Index your code
hub / github.com/amadeus4dev/amadeus-java / parseData

Method parseData

src/main/java/com/amadeus/Response.java:102–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100
101 // Tries to parse the data
102 private void parseData() {
103 final String warningsValue = "warnings";
104 this.parsed = false;
105 this.body = readBody();
106 this.result = parseJson();
107 this.parsed = this.result != null;
108 if (parsed && result.has("data")) {
109 if (result.get("data").isJsonArray()) {
110 this.data = result.get("data").getAsJsonArray();
111 }
112 if (result.get("data").isJsonObject()) {
113 this.data = result.get("data").getAsJsonObject();
114 }
115 }
116 if (parsed && result.has(warningsValue)) {
117 if (result.get(warningsValue).isJsonArray()) {
118 this.warnings = result.get(warningsValue).getAsJsonArray();
119 }
120 if (result.get(warningsValue).isJsonObject()) {
121 this.warnings = result.get(warningsValue).getAsJsonObject();
122 }
123 }
124 }
125
126 // Tries to read the body.
127 private String readBody() {

Callers 1

parseMethod · 0.95

Calls 3

readBodyMethod · 0.95
parseJsonMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected