Created
July 4, 2020 15:54
-
-
Save dsimonow/41bd718650c1f956380cc8cd912647eb to your computer and use it in GitHub Desktop.
This file contains 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
JsonNode notCheckedResponse = aquireStockGlobalQuoteString(stockSymbol); | |
String searchedStockName = stockName; | |
String response = ""; | |
ObjectMapper mapper = new ObjectMapper(); | |
if(notCheckedResponse.has("Error Message")){ | |
try { | |
response = mapper.writeValueAsString(notCheckedResponse); | |
} catch (JsonProcessingException e) { | |
e.printStackTrace(); | |
} | |
} else if (notCheckedResponse.has("Note")) { | |
try { | |
response = mapper.writeValueAsString(notCheckedResponse); | |
} catch (JsonProcessingException e) { | |
e.printStackTrace(); | |
} | |
} else { | |
AVGlobalQuoteResponseDto globalQuoteDTO = null; | |
try { | |
globalQuoteDTO = mapper.treeToValue(notCheckedResponse, AVGlobalQuoteResponseDto.class); | |
} catch (JsonProcessingException e) { | |
log.info(e.getMessage()); | |
e.printStackTrace(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment