Last active
July 2, 2019 04:20
-
-
Save chibenwa/2333657576169ca8a5e733f59e383d5e to your computer and use it in GitHub Desktop.
JMAP Result reference
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ExecutionContext { | |
| private final HashMap<ClientId, Method.Response> previousResponses; | |
| public void addResponse(ClientId clientId, Method.Response response) { | |
| previousResponses.put(clientId, response); | |
| } | |
| public <T> List<T> retrieveResultReferences(ResultReferencesPath path, Class<T> clazz) { | |
| ClientId callId = path.getMethodCallId(); | |
| Method.Response response = Optional.ofNullable(previousResponses.get(callId)).get(); | |
| return response.resolve(path, clazz); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment