/*******************************************************************************
* Copyright 2011 Adrian Cristian Ionescu
*
* 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 ro.zg.opengroups.gwt.shared.vo;
import java.io.Serializable;
import java.sql.Timestamp;
public class User implements Serializable{
/**
*
*/
private static final long serialVersionUID = 8640658043782312274L;
private String username;
private Integer userId;
private Timestamp lastLogin;
private String email;
/**
* @return the username
*/
public String getUsername() {
return username;
}
/**
* @return the userId
*/
public Integer getUserId() {
return userId;
}
/**
* @return the lastLogin
*/
public Timestamp getLastLogin() {
return lastLogin;
}
/**
* @param username the username to set
*/
public void setUsername(String username) {
this.username = username;
}
/**
* @param userId the userId to set
*/
public void setUserId(Integer userId) {
this.userId = userId;
}
/**
* @param lastLogin the lastLogin to set
*/
public void setLastLogin(Timestamp lastLogin) {
this.lastLogin = lastLogin;
}
/**
* @return the email
*/
public String getEmail() {
return email;
}
/**
* @param email the email to set
*/
public void setEmail(String email) {
this.email = email;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((email == null) ? 0 : email.hashCode());
result = prime * result + (int) (userId ^ (userId >>> 32));
result = prime * result + ((username == null) ? 0 : username.hashCode());
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
User other = (User) obj;
if (email == null) {
if (other.email != null)
return false;
} else if (!email.equals(other.email))
return false;
if (userId != other.userId)
return false;
if (username == null) {
if (other.username != null)
return false;
} else if (!username.equals(other.username))
return false;
return true;
}
}