(Object implicitEndpoint2, Object... args)
| 2333 | } |
| 2334 | |
| 2335 | public CompletableFuture<Object> callAsync(Object implicitEndpoint2, Object... args) { |
| 2336 | // First optional arg is "parameters" |
| 2337 | Object parameters = (args != null && args.length > 0) ? args[0] : null; |
| 2338 | |
| 2339 | if (parameters == null) { |
| 2340 | parameters = new HashMap<String, Object>(); |
| 2341 | } |
| 2342 | |
| 2343 | String implicitEndpoint = (String) implicitEndpoint2; |
| 2344 | |
| 2345 | Object info = this.transformedApi.get(implicitEndpoint); |
| 2346 | if (info instanceof Map) { |
| 2347 | @SuppressWarnings("unchecked") |
| 2348 | Map<String, Object> endpointInfo = (Map<String, Object>) info; |
| 2349 | |
| 2350 | String method = (String) endpointInfo.get("method"); |
| 2351 | String path = (String) endpointInfo.get("path"); |
| 2352 | Object api = endpointInfo.get("api"); |
| 2353 | |
| 2354 | Object costObj = endpointInfo.get("cost"); |
| 2355 | Object cost = (costObj != null) ? costObj : 1; |
| 2356 | |
| 2357 | Map<String, Object> emptyMap = new HashMap<>(); |
| 2358 | Map<String, Object> costMap = new HashMap<>(); |
| 2359 | costMap.put("cost", cost); |
| 2360 | |
| 2361 | // body = null here, same as in your C# comment |
| 2362 | // try { |
| 2363 | return this.fetch2(path, api, method, parameters, emptyMap, null, costMap); |
| 2364 | // return CompletableFuture.completedFuture(res); |
| 2365 | // } catch (Exception e) { |
| 2366 | // // throw e; |
| 2367 | // } |
| 2368 | |
| 2369 | } |
| 2370 | |
| 2371 | CompletableFuture<Object> failed = new CompletableFuture<>(); |
| 2372 | failed.completeExceptionally(new RuntimeException("Endpoint not found!")); |
| 2373 | return failed; |
| 2374 | } |
| 2375 | |
| 2376 | public boolean isEmpty(Object a) { |
| 2377 | if (a == null) { |
no test coverage detected