Example #1
0
  public StudentAttributes(Student student) {
    this();
    this.email = student.getEmail();
    this.course = student.getCourseId();
    this.name = student.getName();
    this.lastName = student.getLastName();
    this.comments = Sanitizer.sanitizeTextField(student.getComments());
    this.team = Sanitizer.sanitizeTitle(student.getTeamName());
    this.section =
        ((student.getSectionName() == null)
            ? Const.DEFAULT_SECTION
            : Sanitizer.sanitizeTitle(student.getSectionName()));
    // TODO: Is this supposed to be null or "" ?? Find out and standardize.
    this.googleId = ((student.getGoogleId() == null) ? "" : student.getGoogleId());
    Long keyAsLong = student.getRegistrationKey();
    this.key = (keyAsLong == null ? null : Student.getStringKeyForLongKey(keyAsLong));

    // TODO: this is for backward compatibility with old system. Old system
    // considers "" as unregistered. It should be changed to consider
    // null as unregistered.
  }
  public StudentAttributes(Student student) {
    this();
    this.email = student.getEmail();
    this.course = student.getCourseId();
    this.name = student.getName();
    this.lastName = student.getLastName();
    this.comments = Sanitizer.sanitizeTextField(student.getComments());
    this.team = Sanitizer.sanitizeTitle(student.getTeamName());
    this.section =
        (student.getSectionName() == null)
            ? Const.DEFAULT_SECTION
            : Sanitizer.sanitizeTitle(student.getSectionName());
    this.googleId = (student.getGoogleId() == null) ? "" : student.getGoogleId();
    Long keyAsLong = student.getRegistrationKey();
    this.key = (keyAsLong == null) ? null : Student.getStringKeyForLongKey(keyAsLong);
    /*
     * TODO: this is for backward compatibility with old system.
     * Old system considers "" as unregistered.
     * It should be changed to consider null as unregistered.
     */

    this.createdAt = student.getCreatedAt();
    this.updatedAt = student.getUpdatedAt();
  }