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 thePrincipal
interface.
-
-
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 boolean
equals(Object another)
Checks for equality.String
getName()
Returns the principal name.int
hashCode()
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 benull
or empty string.- Throws:
IllegalArgumentException
- On anull
or 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.
-
-