com.thetransactioncompany.jsonrpc2.server

## 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 the `Principal` interface.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasicPrincipal(String name)` Creates a new principal.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object another)` Checks for equality.
    `String` | `getName()` Returns the principal name.
    `int` | `hashCode()` Returns a hash code for this principal.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.security.Principal

      `implies, toString`

- - ### Constructor Detail

    - #### BasicPrincipal

          public BasicPrincipal(String name)

      Creates a new principal.
      Parameters:
        `name` - The principal name, must not be `null` or empty string.
      Throws:
        `IllegalArgumentException` - On a `null` or empty principal name.

  - ### Method Detail

    - #### equals

          public boolean equals(Object another)

      Checks for equality.
      Specified by:
        `equals` in interface `Principal`
      Overrides:
        `equals` in class `Object`
      Parameters:
        `another` - The object to compare to.

    - #### getName

          public String getName()

      Returns the principal name.
      Specified by:
        `getName` in interface `Principal`
      Returns:
        The principal name.

    - #### hashCode

          public int hashCode()

      Returns a hash code for this principal.
      Specified by:
        `hashCode` in interface `Principal`
      Overrides:
        `hashCode` in class `Object`
      Returns:
        The hash code.