usernamepasswordcredentials.java

来自「CAS在Tomcat中实现单点登录项目,单点登录(Single Sign On 」· Java 代码 · 共 77 行

JAVA
77
字号
/* * Copyright 2007 The JA-SIG Collaborative. All rights reserved. See license * distributed with this file and available online at * http://www.ja-sig.org/products/cas/overview/license/ */package org.jasig.cas.authentication.principal;/** * UsernamePasswordCredentials respresents the username and password that a user * may provide in order to prove the authenticity of who they say they are. *  * @author Scott Battaglia * @version $Revision: 1.2 $ $Date: 2007/01/22 20:35:26 $ * @since 3.0 * <p> * This is a published and supported CAS Server 3 API. * </p> */public class UsernamePasswordCredentials implements Credentials {    /** Unique ID for serialization. */    private static final long serialVersionUID = -8343864967200862794L;    /** The username. */    private String username;    /** The password. */    private String password;    /**     * @return Returns the password.     */    public final String getPassword() {        return this.password;    }    /**     * @param password The password to set.     */    public final void setPassword(final String password) {        this.password = password;    }    /**     * @return Returns the userName.     */    public final String getUsername() {        return this.username;    }    /**     * @param userName The userName to set.     */    public final void setUsername(final String userName) {        this.username = userName;    }    public String toString() {        return this.username;    }    public boolean equals(final Object obj) {        if (obj == null || !obj.getClass().equals(this.getClass())) {            return false;        }        final UsernamePasswordCredentials c = (UsernamePasswordCredentials) obj;        return this.username.equals(c.getUsername())            && this.password.equals(c.getPassword());    }    public int hashCode() {        return this.username.hashCode() ^ this.password.hashCode();    }}

⌨️ 快捷键说明

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