1 25 26 package org.objectweb.easybeans.security.struct; 27 28 import java.io.Serializable ; 29 import java.security.Principal ; 30 31 35 public class JPrincipal implements Principal , Serializable { 36 37 40 private static final long serialVersionUID = 5864848835776239991L; 41 42 45 private String name = null; 46 47 51 public JPrincipal(final String name) { 52 this.name = name; 53 } 54 55 63 @Override 64 public boolean equals(final Object another) { 65 if (!(another instanceof Principal )) { 66 return false; 67 } 68 return name.equals(((Principal ) another).getName()); 70 } 71 72 76 @Override 77 public String toString() { 78 return "Principal[" + name + "]"; 79 } 80 81 85 @Override 86 public int hashCode() { 87 return name.hashCode(); 88 } 89 90 94 public String getName() { 95 return name; 96 } 97 98 } 99 | Popular Tags |