public class GroupPrincipal
extends java.lang.Object
implements java.security.Principal, java.io.Serializable
Principal represent a group of users| Constructor and Description |
|---|
GroupPrincipal(long name,
boolean primaryGroup)
Create a
GroupPrincipal using a
user's group name. |
GroupPrincipal(java.lang.String name,
boolean primaryGroup)
Create a
GroupPrincipal using a
String representation of the user's
group name. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o)
Compares the specified Object with this
NumericGroupPrincipal
for equality. |
java.lang.String |
getName()
Return the user's group name for this
GroupPrincipal. |
int |
hashCode()
Return a hash code for this
NumericGroupPrincipal. |
boolean |
isPrimaryGroup()
Return whether this group represents
the primary group to which this user belongs.
|
java.lang.String |
toString()
Return a string representation of this
NumericGroupPrincipal. |
public GroupPrincipal(java.lang.String name,
boolean primaryGroup)
GroupPrincipal using a
String representation of the user's
group name.
name - the user's groupprimaryGroup - true if the specified group represents the
primary group to which this user belongs.java.lang.NullPointerException - if the name
is null.public GroupPrincipal(long name,
boolean primaryGroup)
GroupPrincipal using a
user's group name.
name - the user's groupprimaryGroup - true if the specified group represents the
primary group to which this user belongs.public java.lang.String getName()
GroupPrincipal.
getName in interface java.security.PrincipalGroupPrincipalpublic boolean isPrimaryGroup()
public java.lang.String toString()
NumericGroupPrincipal.
toString in interface java.security.PrincipaltoString in class java.lang.ObjectNumericGroupPrincipal.public boolean equals(java.lang.Object o)
NumericGroupPrincipal
for equality. Returns true if the given object is also a
NumericGroupPrincipal and the two
NumericGroupPrincipals
have the same group identification number (GID).
equals in interface java.security.Principalequals in class java.lang.Objecto - Object to be compared for equality with this
NumericGroupPrincipal.NumericGroupPrincipal.public int hashCode()
NumericGroupPrincipal.
hashCode in interface java.security.PrincipalhashCode in class java.lang.ObjectNumericGroupPrincipal.