package net.sourceforge.fenixedu.domain; import java.io.Serializable; import net.sourceforge.fenixedu.applicationTier.IUserView; import org.apache.commons.lang.StringUtils; import pt.ist.fenixWebFramework.security.UserView; @SuppressWarnings("serial") public class UpdateEntity implements Serializable { private String username; public UpdateEntity() { final IUserView userView = UserView.getUser(); username = userView != null ? userView.getUsername() : StringUtils.EMPTY; } public UpdateEntity(String username) { this.username = username; } public String getUsername() { return username; } public String externalize() { final IUserView userView = UserView.getUser(); username = userView != null ? userView.getUsername() : StringUtils.EMPTY; return username; } public int hashCode() { return username.hashCode(); } public boolean equals(Object o) { if (o instanceof UpdateEntity) { UpdateEntity other = (UpdateEntity) o; return username.equals(other.getUsername()); } return false; } }