src/main/java/com/loyalty/homework/services/MessageService.java
@NonNull
    public Reply replyToPost(@NonNull final String postId, @NonNull final Reply reply) {
        Validate.notEmpty(postId, "Post id of post can not be empty");
        final Reply replyToSave = new Reply();
        replyToSave.setRootMessageId(postId);
        replyToSave.setMessage(reply.getMessage());
        replyToSave.setMessageDepth(1);
        replyToSave.setCity(reply.getCity());
        replyToSave.setUserName(reply.getUserName() == null || reply.getUserName().trim().isEmpty() ? "anoymous" : reply.getUserName());
        replyDAO.save(replyToSave);
        return replyToSave;

    }
/**
     * Service call that creates a reply to a post
     *
     * @param postId the post that is being replied to
     * @param reply  the reply
     * @return the new unique id associated with the reply
     */
Service call that creates a reply to a post
@param postId the post that is being replied to
@param reply  the reply
@return the new unique id associated with the reply
Service call that creates a reply to a post @param postId the post that is being replied to @param reply the reply @return the new unique id associated with the reply
@NonNull
    public Reply replyToPost(@NonNull final String postId, @NonNull final Reply reply) {
        Validate.notEmpty(postId, "Post id of post can not be empty");
        final Reply replyToSave = new Reply();
        replyToSave.setRootMessageId(postId);
        replyToSave.setMessage(reply.getMessage());
        replyToSave.setMessageDepth(1);
        replyToSave.setCity(reply.getCity());
        replyToSave.setUserName(reply.getUserName() == null || reply.getUserName().trim().isEmpty() ? "anoymous" : reply.getUserName());
        replyDAO.save(replyToSave);
        return replyToSave;
    }
@ NonNull public Reply replyToPost ( @ NonNull final String postId , @ NonNull final Reply reply ) { Validate . notEmpty ( postId , "Post id of post can not be empty" ) ; final Reply replyToSave = new Reply ( ) ; replyToSave . setRootMessageId ( postId ) ; replyToSave . setMessage ( reply . getMessage ( ) ) ; replyToSave . setMessageDepth ( 1 ) ; replyToSave . setCity ( reply . getCity ( ) ) ; replyToSave . setUserName ( reply . getUserName ( ) == null || reply . getUserName ( ) . trim ( ) . isEmpty ( ) ? "anoymous" : reply . getUserName ( ) ) ; replyDAO . save ( replyToSave ) ; return replyToSave ; }
Service call that creates a reply to a post
 @param postId the post that is being replied to
 @param reply  the reply
 @return the new unique id associated with the reply
Service call that creates a reply to a post @param postId the post that is being replied to @param reply the reply @return the new unique id associated with the reply