package org.innovateuk.ifs.registration.form;


/**
 * Form field model for registration of stakeholder users
 */
public class StakeholderRegistrationForm {
    private String firstName;
    private String lastName;
    private String password;

    public StakeholderRegistrationForm(String firstName, String lastName, String password) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.password = password;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}

@@ -45,166 +45,490 @@
 ;%0A%0A%0A
-/**%0A * Form field model for registration of stakeholder users%0A */%0Apublic class StakeholderRegistrationForm %7B%0A    private String firstName;%0A    private
+import org.apache.commons.lang3.builder.EqualsBuilder;%0Aimport org.apache.commons.lang3.builder.HashCodeBuilder;%0Aimport org.hibernate.validator.constraints.NotBlank;%0A%0Aimport javax.validation.constraints.Pattern;%0Aimport javax.validation.constraints.Size;%0A%0A/**%0A * Form field model for registration of stakeholder users%0A */%0Apublic class StakeholderRegistrationForm extends InternalUserRegistrationForm %7B%0A%0A    public StakeholderRegistrationForm(String firstName, String lastName,
  String 
 last
@@ -527,112 +527,497 @@
 ing 
-lastName;%0A    private String password;%0A%0A    public StakeholderRegistrationForm(String 
+password) %7B%0A        this.firstName = firstName;%0A        this.lastName = lastName;%0A        this.password = password;%0A    %7D%0A%0A    @NotBlank(message = %22%7Bvalidation.standard.firstname.required%7D%22)%0A    @Pattern(regexp = %22%5B%5C%5Cp%7BL%7D %5C%5C-'%5D*%22, message = %22%7Bvalidation.standard.firstname.invalid%7D%22)%0A    @Size.List (%7B%0A            @Size(min=2, message=%22%7Bvalidation.standard.firstname.length.min%7D%22),%0A            @Size(max=70, message=%22%7Bvalidation.standard.
 first
-Name,
+name.length.max%7D%22),%0A    %7D)%0A    private
  String 
 last
@@ -1016,96 +1016,381 @@
 ing 
-la
+fir
 stName
-, String password) %7B%0A        this.firstName = firstName;%0A        this
+;%0A%0A    @NotBlank(message = %22%7Bvalidation.standard.lastname.required%7D%22)%0A    @Pattern(regexp = %22%5B%5C%5Cp%7BL%7D %5C%5C-'%5D*%22, message = %22%7Bvalidation.standard.lastname.invalid%7D%22)%0A    @Size.List (%7B%0A            @Size(min=2, message=%22%7Bvalidation.standard.lastname.length.min%7D%22),%0A            @Size(max=70, message=%22%7Bvalidation.standard
 .last
-Name =
+name.length.max%7D%22),%0A    %7D)%0A    private String
  las
@@ -1400,47 +1400,208 @@
 me;%0A
+%0A
     
-    this.password = password;%0A    %7D
+@NotBlank(message = %22%7Bvalidation.standard.password.required%7D%22)%0A    @Size.List (%7B%0A            @Size(min=8, message=%22%7Bvalidation.standard.password.length.min%7D%22),%0A    %7D)%0A    private String password;
 %0A%0A  
@@ -2064,11 +2064,691 @@
 d;%0A    %7D
+%0A%0A    @Override%0A    public boolean equals(Object o) %7B%0A        if (this == o) return true;%0A%0A        if (o == null %7C%7C getClass() != o.getClass()) return false;%0A%0A        StakeholderRegistrationForm that = (StakeholderRegistrationForm) o;%0A%0A        return new EqualsBuilder()%0A                .append(firstName, that.firstName)%0A                .append(lastName, that.lastName)%0A                .append(password, that.password)%0A                .isEquals();%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A        return new HashCodeBuilder(17, 37)%0A                .append(firstName)%0A                .append(lastName)%0A                .append(password)%0A                .toHashCode();%0A    %7D
 %0A%7D%0A

Add validation and override equals for stakeholder registration form