jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java
equal
deleted
inserted
replaced
24 */ |
24 */ |
25 |
25 |
26 package com.sun.security.auth; |
26 package com.sun.security.auth; |
27 |
27 |
28 import java.security.Principal; |
28 import java.security.Principal; |
|
29 import static sun.security.util.ResourcesMgr.getAuthResourceString; |
29 |
30 |
30 /** |
31 /** |
31 * This class implements the {@code Principal} interface |
32 * This class implements the {@code Principal} interface |
32 * and represents a user's Solaris group identification number (GID). |
33 * and represents a user's Solaris group identification number (GID). |
33 * |
34 * |
51 Principal, |
52 Principal, |
52 java.io.Serializable { |
53 java.io.Serializable { |
53 |
54 |
54 private static final long serialVersionUID = 2345199581042573224L; |
55 private static final long serialVersionUID = 2345199581042573224L; |
55 |
56 |
56 private static final java.util.ResourceBundle rb = |
|
57 java.util.ResourceBundle.getBundle("sun.security.util.AuthResources"); |
|
58 |
|
59 /** |
57 /** |
60 * @serial |
58 * @serial |
61 */ |
59 */ |
62 private String name; |
60 private String name; |
63 |
61 |
80 * @exception NullPointerException if the {@code name} |
78 * @exception NullPointerException if the {@code name} |
81 * is {@code null}. |
79 * is {@code null}. |
82 */ |
80 */ |
83 public SolarisNumericGroupPrincipal(String name, boolean primaryGroup) { |
81 public SolarisNumericGroupPrincipal(String name, boolean primaryGroup) { |
84 if (name == null) |
82 if (name == null) |
85 throw new NullPointerException(rb.getString("provided.null.name")); |
83 throw new NullPointerException(getAuthResourceString("provided.null.name")); |
86 |
84 |
87 this.name = name; |
85 this.name = name; |
88 this.primaryGroup = primaryGroup; |
86 this.primaryGroup = primaryGroup; |
89 } |
87 } |
90 |
88 |
144 * |
142 * |
145 * @return a string representation of this |
143 * @return a string representation of this |
146 * {@code SolarisNumericGroupPrincipal}. |
144 * {@code SolarisNumericGroupPrincipal}. |
147 */ |
145 */ |
148 public String toString() { |
146 public String toString() { |
149 return((primaryGroup ? |
147 return primaryGroup ? |
150 rb.getString |
148 getAuthResourceString |
151 ("SolarisNumericGroupPrincipal.Primary.Group.") + name : |
149 ("SolarisNumericGroupPrincipal.Primary.Group.") + name : |
152 rb.getString |
150 getAuthResourceString |
153 ("SolarisNumericGroupPrincipal.Supplementary.Group.") + name)); |
151 ("SolarisNumericGroupPrincipal.Supplementary.Group.") + name; |
154 } |
152 } |
155 |
153 |
156 /** |
154 /** |
157 * Compares the specified Object with this |
155 * Compares the specified Object with this |
158 * {@code SolarisNumericGroupPrincipal} |
156 * {@code SolarisNumericGroupPrincipal} |