@Override public Map<String, ?> getComment(String authenticationToken, String commentId) { Comment comment = commentManager.getComment(Long.parseLong(commentId)); Map<String, Object> commentStruct = null; if (null != comment && permissionManager.hasPermission(AuthenticatedUserThreadLocal.getUser(), Permission.VIEW, comment)) { commentStruct = new Hashtable<String, Object>(); commentStruct.put("id", comment.getIdAsString()); if (null != comment.getParent()) commentStruct.put("parentId", comment.getParent().getIdAsString()); commentStruct.put("ownerId", comment.getOwner().getIdAsString()); commentStruct.put("content", comment.getBodyAsString()); if (StringUtils.isNotBlank(comment.getCreatorName())) commentStruct.put("creator", comment.getCreatorName()); commentStruct.put("created", comment.getCreationDate()); if (StringUtils.isNotBlank(comment.getLastModifierName())) commentStruct.put("lastModifier", comment.getLastModifierName()); commentStruct.put("lastModified", comment.getLastModificationDate()); } return commentStruct; }