1 23 package com.sun.enterprise.deployment; 24 25 import java.security.Principal ; 26 27 32 public class PrincipalImpl implements Principal , java.io.Serializable { 33 34 37 private String name; 38 39 43 public PrincipalImpl(String user) { 44 this.name = user; 45 } 46 47 54 public boolean equals(Object another) { 55 if (another instanceof Group) { 59 return false; 60 } else if (another instanceof PrincipalImpl) { 61 Principal p = (Principal ) another; 62 return getName().equals(p.getName()); 63 } else 64 return false; 65 } 66 67 71 public String toString() { 72 return getName(); 73 } 74 75 79 public int hashCode() { 80 return name.hashCode(); 81 } 82 83 87 public String getName() { 88 return name; 89 } 90 91 } 92 | Popular Tags |