/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package open.dolphin.security;

import java.security.Principal;

/**
 *
 * @author tomohiro
 */
public class SecurityPrincipal implements Principal {

    private String name;

    public SecurityPrincipal(String name) {
        this.name = name;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return "SecutiryPrincipal: " + name;
    }

    @Override
    public int hashCode() {
        return name.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final SecurityPrincipal other = (SecurityPrincipal) obj;
        if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
            return false;
        }
        return true;
    }
}
