/*
 * Copyright 2014 Open mHealth
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.openmhealth.dsu.domain;

import org.hibernate.validator.constraints.Email;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * A bean containing user registration data.
 *
 * @author Emerson Farrugia
 */
public class EndUserRegistrationData {

    private String username;
    private String password;
    private String emailAddress;

    @NotNull
    @Size(min = 1)
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @NotNull
    @Size(min = 1)
    public String getPassword() {
        return password;
    }

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

    @Email
    public String getEmailAddress() {
        return emailAddress;
    }

    public void setEmailAddress(String emailAddress) {
        this.emailAddress = emailAddress;
    }
}

@@ -766,16 +766,17 @@
 .Size;%0A%0A
+%0A
 /**%0A * A
@@ -1542,11 +1542,1080 @@
 s;%0A    %7D
+%0A%0A    @SuppressWarnings(%22RedundantIfStatement%22)%0A    @Override%0A    public boolean equals(Object object) %7B%0A%0A        if (this == object) %7B%0A            return true;%0A        %7D%0A        if (object == null %7C%7C getClass() != object.getClass()) %7B%0A            return false;%0A        %7D%0A%0A        EndUserRegistrationData that = (EndUserRegistrationData) object;%0A%0A        if (emailAddress != null ? !emailAddress.equals(that.emailAddress) : that.emailAddress != null) %7B%0A            return false;%0A        %7D%0A        if (password != null ? !password.equals(that.password) : that.password != null) %7B%0A            return false;%0A        %7D%0A        if (username != null ? !username.equals(that.username) : that.username != null) %7B%0A            return false;%0A        %7D%0A%0A        return true;%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A%0A        int result = username != null ? username.hashCode() : 0;%0A        result = 31 * result + (password != null ? password.hashCode() : 0);%0A        result = 31 * result + (emailAddress != null ? emailAddress.hashCode() : 0);%0A%0A        return result;%0A    %7D
 %0A%7D%0A

Implement equals() and hashCode() in end user registration data DTO.