Class MessageContext.BasicPrincipal
- java.lang.Object
-
- com.thetransactioncompany.jsonrpc2.server.MessageContext.BasicPrincipal
-
- All Implemented Interfaces:
Principal
- Enclosing class:
- MessageContext
public class MessageContext.BasicPrincipal extends Object implements Principal
Minimal implementation of thePrincipalinterface.
-
-
Constructor Summary
Constructors Constructor Description BasicPrincipal(String name)Creates a new principal.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object another)Checks for equality.StringgetName()Returns the principal name.inthashCode()Returns a hash code for this principal.
-
-
-
Constructor Detail
-
BasicPrincipal
public BasicPrincipal(String name)
Creates a new principal.- Parameters:
name- The principal name, must not benullor empty string.- Throws:
IllegalArgumentException- On anullor empty principal name.
-
-
Method Detail
-
equals
public boolean equals(Object another)
Checks for equality.
-
hashCode
public int hashCode()
Returns a hash code for this principal.
-
-