1 7 8 package com.sun.security.auth; 9 10 import java.security.Principal ; 11 12 30 @Deprecated 31 public class SolarisNumericUserPrincipal implements 32 Principal , 33 java.io.Serializable { 34 35 private static final long serialVersionUID = -3178578484679887104L; 36 37 private static final java.util.ResourceBundle rb = 38 (java.util.ResourceBundle )java.security.AccessController.doPrivileged 39 (new java.security.PrivilegedAction () { 40 public Object run() { 41 return (java.util.ResourceBundle.getBundle 42 ("sun.security.util.AuthResources")); 43 } 44 }); 45 46 47 50 private String name; 51 52 64 public SolarisNumericUserPrincipal(String name) { 65 if (name == null) 66 throw new NullPointerException (rb.getString("provided null name")); 67 68 this.name = name; 69 } 70 71 80 public SolarisNumericUserPrincipal(long name) { 81 this.name = (new Long (name)).toString(); 82 } 83 84 93 public String getName() { 94 return name; 95 } 96 97 106 public long longValue() { 107 return ((new Long (name)).longValue()); 108 } 109 110 119 public String toString() { 120 return(rb.getString("SolarisNumericUserPrincipal: ") + name); 121 } 122 123 139 public boolean equals(Object o) { 140 if (o == null) 141 return false; 142 143 if (this == o) 144 return true; 145 146 if (!(o instanceof SolarisNumericUserPrincipal)) 147 return false; 148 SolarisNumericUserPrincipal that = (SolarisNumericUserPrincipal)o; 149 150 if (this.getName().equals(that.getName())) 151 return true; 152 return false; 153 } 154 155 162 public int hashCode() { 163 return name.hashCode(); 164 } 165 } 166 | Popular Tags |