1 26 27 package org.objectweb.jonas.security.auth; 28 29 import java.io.Serializable ; 30 import java.security.Principal ; 31 32 36 public class JPrincipal implements Principal , Serializable { 37 38 39 42 private String name = null; 43 44 48 public JPrincipal(String name) { 49 this.name = name; 50 } 51 52 57 public boolean equals(Object another) { 58 if (!(another instanceof Principal )) { 59 return false; 60 } 61 return name.equals(((Principal ) another).getName()); 63 } 64 65 69 public String toString() { 70 return "Principal[" + name + "]"; 71 } 72 73 74 78 public int hashCode() { 79 return name.hashCode(); 80 } 81 82 86 public String getName() { 87 return name; 88 } 89 90 91 92 93 } 94 | Popular Tags |