1 7 8 package com.sun.security.auth; 9 10 import java.security.Principal ; 11 12 30 @Deprecated 31 public class SolarisPrincipal implements Principal , java.io.Serializable { 32 33 private static final long serialVersionUID = -7840670002439379038L; 34 35 private static final java.util.ResourceBundle rb = 36 (java.util.ResourceBundle )java.security.AccessController.doPrivileged 37 (new java.security.PrivilegedAction () { 38 public Object run() { 39 return (java.util.ResourceBundle.getBundle 40 ("sun.security.util.AuthResources")); 41 } 42 }); 43 44 45 48 private String name; 49 50 60 public SolarisPrincipal(String name) { 61 if (name == null) 62 throw new NullPointerException (rb.getString("provided null name")); 63 64 this.name = name; 65 } 66 67 74 public String getName() { 75 return name; 76 } 77 78 85 public String toString() { 86 return(rb.getString("SolarisPrincipal: ") + name); 87 } 88 89 103 public boolean equals(Object o) { 104 if (o == null) 105 return false; 106 107 if (this == o) 108 return true; 109 110 if (!(o instanceof SolarisPrincipal)) 111 return false; 112 SolarisPrincipal that = (SolarisPrincipal)o; 113 114 if (this.getName().equals(that.getName())) 115 return true; 116 return false; 117 } 118 119 126 public int hashCode() { 127 return name.hashCode(); 128 } 129 } 130 | Popular Tags |