1 7 8 package com.sun.security.auth; 9 10 import java.security.Principal ; 11 12 27 public class NTUserPrincipal implements Principal , java.io.Serializable { 28 29 private static final long serialVersionUID = -8737649811939033735L; 30 31 34 private String name; 35 36 46 public NTUserPrincipal(String name) { 47 if (name == null) { 48 java.text.MessageFormat form = new java.text.MessageFormat 49 (sun.security.util.ResourcesMgr.getString 50 ("invalid null input: value", 51 "sun.security.util.AuthResources")); 52 Object [] source = {"name"}; 53 throw new NullPointerException (form.format(source)); 54 } 55 this.name = name; 56 } 57 58 65 public String getName() { 66 return name; 67 } 68 69 76 public String toString() { 77 java.text.MessageFormat form = new java.text.MessageFormat 78 (sun.security.util.ResourcesMgr.getString 79 ("NTUserPrincipal: name", 80 "sun.security.util.AuthResources")); 81 Object [] source = {name}; 82 return form.format(source); 83 } 84 85 99 public boolean equals(Object o) { 100 if (o == null) 101 return false; 102 103 if (this == o) 104 return true; 105 106 if (!(o instanceof NTUserPrincipal)) 107 return false; 108 NTUserPrincipal that = (NTUserPrincipal)o; 109 110 if (name.equals(that.getName())) 111 return true; 112 return false; 113 } 114 115 122 public int hashCode() { 123 return this.getName().hashCode(); 124 } 125 } 126 | Popular Tags |