// fetch external user Id
public static String extractUserId(String jsonObject)
throws ParseException, JsonParseException, JsonMappingException, IOException {
String methodName = "extractUserId";
LOGGER.debug(CLASS_NAME + "/" + methodName);
System.out.println(CLASS_NAME + "/" + methodName);
String externalUserIDValue = null;
ObjectMapper objectMapper = new ObjectMapper();
Entities entities = objectMapper.readValue(jsonObject, Entities.class);
System.out.println("Entities lenght : " + entities.getEntities().length);
if (entities.getEntities().length != 0) {
for (User user : entities.getEntities()) {
externalUserIDValue = user.getExternalId();
}
}
System.out.println("Exiting from the method : " + methodName);
LOGGER.debug("Exiting from the method : " + methodName);
return externalUserIDValue;
}
No comments:
Post a Comment