All Downloads are FREE. Search and download functionalities are using the official Maven repository.

test.ca.odell.glazedlists.hibernate.User Maven / Gradle / Ivy

There is a newer version: 1.9.1
Show newest version
/* Glazed Lists                                                 (c) 2003-2006 */
/* http://publicobject.com/glazedlists/                      publicobject.com,*/
/*                                                     O'Dell Engineering Ltd.*/
package ca.odell.glazedlists.hibernate;

import ca.odell.glazedlists.BasicEventList;
import ca.odell.glazedlists.EventList;

import java.io.Serializable;

/**
 * Helper class for User.
 * 
 * @author Holger Brands
 */
public class User implements Serializable {
    
    private static final long serialVersionUID = 0L;

    /** Username is Id. */
    private String userName;

    /** List of nicknames. */
    private EventList nickNames = new BasicEventList();

    /** List of email addresses. */
    private EventList emailAddresses = new BasicEventList();

    /** List of roles. */
    private EventList roles = new BasicEventList();

    /**
     * Default constructor for hibernate.
     */
    User() {
    }

    /**
     * Constructor with name. 
     */
    public User(String userName) {
        this.userName = userName;
    }

    /**
     * Gets the user name.
     */
    public String getUserName() {
        return userName;
    }

    /**
     * Sets the user name.
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     * Gets the email addresses.
     */
    public EventList getEmailAddresses() {
        return emailAddresses;
    }

    /**
     * Sets the email addresses.
     */
    public void setEmailAddresses(EventList emailAddresses) {
        this.emailAddresses = emailAddresses;
    }
    
    /**
     * Gets the nicknames.
     */
    public EventList getNickNames() {
        return nickNames;
    }

    /**
     * Sets the nicknames.
     */
    private void setNickNames(EventList nickNames) {
        this.nickNames = nickNames;
    }
    
    public void addNickName(String nickName) {
        nickNames.add(nickName);
    }

    public void removeNickName(String nickName) {
        nickNames.remove(nickName);
    }
    
    public EventList getRoles() {
        return roles;
    }
    
    public void addRole(Role role) {
        roles.add(role);
        role.addUser(this);
    }

    public void removeRole(Role role) {
        roles.remove(role);
        role.removeUser(this);
    }
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy