1 7 8 package com.sun.security.auth; 9 10 import java.security.Principal ; 11 12 33 public class NTSid implements Principal , java.io.Serializable { 34 35 private static final long serialVersionUID = 4412290580770249885L; 36 37 40 private String sid; 41 42 55 public NTSid (String stringSid) { 56 if (stringSid == null) { 57 java.text.MessageFormat form = new java.text.MessageFormat 58 (sun.security.util.ResourcesMgr.getString 59 ("invalid null input: value", 60 "sun.security.util.AuthResources")); 61 Object [] source = {"stringSid"}; 62 throw new NullPointerException (form.format(source)); 63 } 64 if (stringSid.length() == 0) { 65 throw new IllegalArgumentException 66 (sun.security.util.ResourcesMgr.getString 67 ("Invalid NTSid value", 68 "sun.security.util.AuthResources")); 69 } 70 sid = new String (stringSid); 71 } 72 73 80 public String getName() { 81 return sid; 82 } 83 84 91 public String toString() { 92 java.text.MessageFormat form = new java.text.MessageFormat 93 (sun.security.util.ResourcesMgr.getString 94 ("NTSid: name", 95 "sun.security.util.AuthResources")); 96 Object [] source = {sid}; 97 return form.format(source); 98 } 99 100 114 public boolean equals(Object o) { 115 if (o == null) 116 return false; 117 118 if (this == o) 119 return true; 120 121 if (!(o instanceof NTSid)) 122 return false; 123 NTSid that = (NTSid)o; 124 125 if (sid.equals(that.sid)) { 126 return true; 127 } 128 return false; 129 } 130 131 138 public int hashCode() { 139 return sid.hashCode(); 140 } 141 } 142 | Popular Tags |