Package java.security
Interface Principal
- All Known Subinterfaces:
Group
- All Known Implementing Classes:
BasicUserPrincipal,Identity,IdentityScope,NTUserPrincipal,Signer,SystemScope,X500Principal,X509Principal
public interface Principal
Principals are objects which have identities. These can be
individuals, groups, corporations, unique program executions, etc.-
Method Summary
Modifier and Type Method Description booleanequals(Object obj)Compares the specified object with thisPrincipalfor equality and returnstrueif the specified object is equal,falseotherwise.StringgetName()Returns the name of thisPrincipal.inthashCode()Returns the hash code value for thisPrincipal.StringtoString()Returns a string containing a concise, human-readable description of thisPrincipal.
-
Method Details
-
equals
Compares the specified object with thisPrincipalfor equality and returnstrueif the specified object is equal,falseotherwise.- Overrides:
equalsin classObject- Parameters:
obj- object to be compared for equality with thisPrincipal.- Returns:
trueif the specified object is equal to thisPrincipal, otherwisefalse.- See Also:
Object.hashCode()
-
getName
String getName()Returns the name of thisPrincipal.- Returns:
- the name of this
Principal.
-
hashCode
int hashCode()Returns the hash code value for thisPrincipal. Returns the same hash code forPrincipals that are equal to each other as required by the general contract ofObject.hashCode().- Overrides:
hashCodein classObject- Returns:
- the hash code value for this
Principal. - See Also:
Object.equals(Object),equals(Object)
-
toString
String toString()Returns a string containing a concise, human-readable description of thisPrincipal.
-