Class HttpPrincipal
java.lang.Object
com.sun.net.httpserver.HttpPrincipal
- All Implemented Interfaces:
Principal
-
Constructor Summary
ConstructorsConstructorDescriptionHttpPrincipal(String username, String realm) Creates aHttpPrincipalfrom the givenusernameandrealm. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompare two instances ofHttpPrincipal.getName()Returns the contents of this principal in the form realm:username.getRealm()Returns therealmthis object was created with.Returns theusernamethis object was created with.inthashCode()Returns a hashcode for thisHttpPrincipal.toString()Returns the same string asgetName().
-
Constructor Details
-
HttpPrincipal
Creates aHttpPrincipalfrom the givenusernameandrealm.- Parameters:
username- the name of the user within the realmrealm- the realm for this user- Throws:
NullPointerException- if either username or realm arenull
-
-
Method Details
-
equals
Compare two instances ofHttpPrincipal. Returnstrueif another is an instance ofHttpPrincipal, and its username and realm are equal to this object's username and realm. Returnsfalseotherwise. -
getName
-
getUsername
Returns theusernamethis object was created with.- Returns:
- the name of the user associated with this object
-
getRealm
Returns therealmthis object was created with.- Returns:
- the realm associated with this object
-
hashCode
-
toString
-