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

Method page

src/main/java/com/amadeus/HTTPClient.java:424–441  ·  view source on GitHub ↗

Fetches the response for another page. @hide as ony used internally

(String pageName, Response response)

Source from the content-addressed store, hash-verified

422 * @hide as ony used internally
423 */
424 protected Response page(String pageName, Response response) throws ResponseException {
425 JsonObject metaLinks = response.getResult().get("meta")
426 .getAsJsonObject().get("links").getAsJsonObject();
427 JsonElement pageElement = metaLinks.get(pageName);
428
429 if (pageElement == null) {
430 return null;
431 }
432
433 String[] parts = pageElement.getAsString().split("page%5Boffset%5D=");
434 String pageNumber = parts[1].split("&")[0];
435
436 Request request = response.getRequest();
437 Params params = (Params) request.getParams().clone();
438 params.put("page[offset]", pageNumber);
439
440 return request(request.getVerb(), request.getPath(), params, "emptyBody");
441 }
442
443
444 /**

Callers 14

previousMethod · 0.95
nextMethod · 0.95
firstMethod · 0.95
lastMethod · 0.95
testNextResponseMethod · 0.80
testPreviousResponseMethod · 0.80
testFirstResponseMethod · 0.80
testLastResponseMethod · 0.80
testNextResourceMethod · 0.80
testPreviousResourceMethod · 0.80
testFirstResourceMethod · 0.80
testLastResourceMethod · 0.80

Calls 3

requestMethod · 0.95
fromArrayMethod · 0.95
getMethod · 0.45

Tested by 10

testNextResponseMethod · 0.64
testPreviousResponseMethod · 0.64
testFirstResponseMethod · 0.64
testLastResponseMethod · 0.64
testNextResourceMethod · 0.64
testPreviousResourceMethod · 0.64
testFirstResourceMethod · 0.64
testLastResourceMethod · 0.64
testPageMethod · 0.64
testPageWithoutLinksMethod · 0.64