⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userprincipal.java

📁 GridSphere 门户 提供一个基于 portlet 的高级开放源代码门户。GridSphere 是在欧盟提供基金的 GridLab 项目下开发的
💻 JAVA
字号:
/* * Created by Dmitry Gavrilov 05.04.2005 */package org.gridsphere.services.core.user;import java.io.Serializable;import java.security.Principal;/** * This class represents a very simple implementation of the * <code>java.security.Principal</code> interface. *  * @author Dmitry Gavrilov */public class UserPrincipal implements Principal, Serializable {    /* A <code> serialVersionUID </code> value. */    private static final long serialVersionUID = 3546647607158846512L;    /* A name of this principal. */    private String principalName = null;    /**     * Constructs a <code>UserPrincipal</code> object with the given name.     *      * @param userName the user name     *            a name of this principal.     * @throws IllegalArgumentException     *             if the name of principal is null.     */    public UserPrincipal(String userName) {      principalName = userName;    }    /**     * Returns a principal's name.     *      * @return a principal's name.     */    public String getName() {        return principalName;    }    /*     * (non-Javadoc)     *      * @see java.lang.Object#equals(java.lang.Object)     */    public boolean equals(Object obj) {        if (!(obj instanceof UserPrincipal))            return false;        UserPrincipal other = (UserPrincipal) obj;        return principalName.equals(other.principalName);    }    /*     * (non-Javadoc)     *      * @see java.lang.Object#hashCode()     */    public int hashCode() {        return principalName.hashCode();    }    /*     * (non-Javadoc)     *      * @see java.lang.Object#toString()     */    public String toString() {        return principalName;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -