1 7 8 package com.sun.security.auth; 9 10 import java.security.Principal ; 11 12 31 public class NTDomainPrincipal implements Principal , java.io.Serializable { 32 33 private static final long serialVersionUID = -4408637351440771220L; 34 35 38 private String name; 39 40 50 public NTDomainPrincipal(String name) { 51 if (name == null) { 52 java.text.MessageFormat form = new java.text.MessageFormat 53 (sun.security.util.ResourcesMgr.getString 54 ("invalid null input: value", 55 "sun.security.util.AuthResources")); 56 Object [] source = {"name"}; 57 throw new NullPointerException (form.format(source)); 58 } 59 this.name = name; 60 } 61 62 71 public String getName() { 72 return name; 73 } 74 75 82 public String toString() { 83 java.text.MessageFormat form = new java.text.MessageFormat 84 (sun.security.util.ResourcesMgr.getString 85 ("NTDomainPrincipal: name", 86 "sun.security.util.AuthResources")); 87 Object [] source = {name}; 88 return form.format(source); 89 } 90 91 105 public boolean equals(Object o) { 106 if (o == null) 107 return false; 108 109 if (this == o) 110 return true; 111 112 if (!(o instanceof NTDomainPrincipal)) 113 return false; 114 NTDomainPrincipal that = (NTDomainPrincipal)o; 115 116 if (name.equals(that.getName())) 117 return true; 118 return false; 119 } 120 121 128 public int hashCode() { 129 return this.getName().hashCode(); 130 } 131 } 132 | Popular Tags |