FileDocCategorySizeDatePackage
BasicUserPrincipal.javaAPI DocAndroid 1.5 API2880Wed May 06 22:41:10 BST 2009org.apache.http.auth

BasicUserPrincipal

public final class BasicUserPrincipal extends Object implements Principal
Basic user principal used for HTTP authentication
author
Oleg Kalnichevski
since
4.0

Fields Summary
private final String
username
Constructors Summary
public BasicUserPrincipal(String username)

        super();
        if (username == null) {
            throw new IllegalArgumentException("User name may not be null");
        }
        this.username = username;
    
Methods Summary
public booleanequals(java.lang.Object o)

        if (o == null) return false;
        if (this == o) return true;
        if (o instanceof BasicUserPrincipal) {
            BasicUserPrincipal that = (BasicUserPrincipal) o;
            if (LangUtils.equals(this.username, that.username)) {
                return true;
            }
        }
        return false;
    
public java.lang.StringgetName()

        return this.username;
    
public inthashCode()

        int hash = LangUtils.HASH_SEED;
        hash = LangUtils.hashCode(hash, this.username);
        return hash;
    
public java.lang.StringtoString()

        StringBuilder buffer = new StringBuilder();
        buffer.append("[principal: ");
        buffer.append(this.username);
        buffer.append("]");
        return buffer.toString();