src/main/java/com/loyalty/homework/services/MessageService.java
@NonNull
    public Post post(@NonNull final String userName, @NonNull final Post post) {
        Validate.notEmpty(userName, "User Name can not be empty");
        final Post postToSave = new Post();
        postToSave.setUserName(userName);
        postToSave.setMessage(post.getMessage());
        postToSave.setCity(post.getCity());
        postsDAO.save(postToSave);
        return postToSave;
    }
/**
     * Service call that creates a root posts and persists it.
     *
     * @param userName The username of the user
     * @param post     the post to be saved
     * @return unique message id associated with the message
     */
Service call that creates a root posts and persists it.
@param userName The username of the user
@param post     the post to be saved
@return unique message id associated with the message
Service call that creates a root posts and persists it . @param userName The username of the user @param post the post to be saved @return unique message id associated with the message
@NonNull
    public Post post(@NonNull final String userName, @NonNull final Post post) {
        Validate.notEmpty(userName, "User Name can not be empty");
        final Post postToSave = new Post();
        postToSave.setUserName(userName);
        postToSave.setMessage(post.getMessage());
        postToSave.setCity(post.getCity());
        postsDAO.save(postToSave);
        return postToSave;
    }
@ NonNull public Post post ( @ NonNull final String userName , @ NonNull final Post post ) { Validate . notEmpty ( userName , "User Name can not be empty" ) ; final Post postToSave = new Post ( ) ; postToSave . setUserName ( userName ) ; postToSave . setMessage ( post . getMessage ( ) ) ; postToSave . setCity ( post . getCity ( ) ) ; postsDAO . save ( postToSave ) ; return postToSave ; }
Service call that creates a root posts and persists it.
Service call that creates a root posts and persists it .