package com.sudoku.data.model;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * @author jonathan
 */

public class Comment {
  /**
   * Champs de la classe Comment
   * *
   */
  private User author;
  private String pseudo;
  private String comment;
  private Integer grade;

  /**
   * Méthode de la classe  Comment
   */

  public Comment(String comment, Integer grade, User u) {
    this.comment = comment;
    this.grade = grade;
    this.author = u;
    this.pseudo = u.getPseudo();
  }

  public static Comment buildFromAvroComment(
      com.sudoku.comm.generated.Comment comment) {
    return new Comment(comment.getComment(), comment.getGrade(),
        User.buildFromAvroUser(comment.getAuthor()));
  }

  public User getAuthor() {
    return author;
  }

  public String getPseudo() {
    return pseudo;
  }

  public String getComment() {
    return comment;
  }

  public void setComment(String comment) {
    this.comment = comment;
  }

  public Integer getGrade() {
    return grade;
  }

  public void setGrade(Integer grade) {
    this.grade = grade;
  }
}


@@ -325,16 +325,22 @@
 private 
+final 
 User aut
@@ -350,24 +350,30 @@
 ;%0A  private 
+final 
 String pseud
@@ -375,16 +375,102 @@
 pseudo;%0A
+  private final String userSalt; // We use the salt as an UUID to identify the poster%0A
   privat
@@ -557,18 +557,82 @@
 ment%0A   
-*/
+  * @param comment%0A     * @param grade%0A     * @param u%0A   */%0A  %0A  
 %0A%0A  publ
@@ -789,16 +789,49 @@
 eudo();%0A
+    this.userSalt = u.getSalt();%0A
   %7D%0A%0A  p

Add final and add salt as an UUID