Package com.enonic.xp.security

## Class PrincipalKey

- java.lang.Object
- - com.enonic.xp.security.PrincipalKey

- All Implemented Interfaces:
    `Serializable`

      @PublicApi
      public final class PrincipalKey
      extends Object
      implements Serializable

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static String` | `GROUPS_NODE_NAME` |
    `static String` | `IDENTITY_NODE_NAME` |
    `static String` | `ROLES_NODE_NAME` |
    `static String` | `USERS_NODE_NAME` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `equals​(Object o)` |
    `static PrincipalKey` | `from​(String principalKey)` |
    `String` | `getId()` |
    `IdProviderKey` | `getIdProviderKey()` |
    `PrincipalType` | `getType()` |
    `int` | `hashCode()` |
    `boolean` | `isAnonymous()` |
    `boolean` | `isGroup()` |
    `boolean` | `isRole()` |
    `boolean` | `isUser()` |
    `static PrincipalKey` | `ofAnonymous()` |
    `static PrincipalKey` | `ofGroup​(IdProviderKey idProvider, String groupId)` |
    `static PrincipalKey` | `ofRole​(String roleId)` |
    `static PrincipalKey` | `ofSuperUser()` |
    `static PrincipalKey` | `ofUser​(IdProviderKey idProvider, String userId)` |
    `NodePath` | `toPath()` |
    `String` | `toString()` |

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

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

- - ### Field Detail

    - #### IDENTITY_NODE_NAME

          public static final String IDENTITY_NODE_NAME

      See Also:
        Constant Field Values

    - #### ROLES_NODE_NAME

          public static final String ROLES_NODE_NAME

      See Also:
        Constant Field Values

    - #### GROUPS_NODE_NAME

          public static final String GROUPS_NODE_NAME

      See Also:
        Constant Field Values

    - #### USERS_NODE_NAME

          public static final String USERS_NODE_NAME

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### from

          public static PrincipalKey from​(String principalKey)

    - #### getType

          public PrincipalType getType()

    - #### getId

          public String getId()

    - #### isUser

          public boolean isUser()

    - #### isGroup

          public boolean isGroup()

    - #### isRole

          public boolean isRole()

    - #### isAnonymous

          public boolean isAnonymous()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals​(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### ofUser

          public static PrincipalKey ofUser​(IdProviderKey idProvider,
                                            String userId)

    - #### ofGroup

          public static PrincipalKey ofGroup​(IdProviderKey idProvider,
                                             String groupId)

    - #### ofRole

          public static PrincipalKey ofRole​(String roleId)

    - #### ofAnonymous

          public static PrincipalKey ofAnonymous()

    - #### ofSuperUser

          public static PrincipalKey ofSuperUser()

    - #### getIdProviderKey

          public IdProviderKey getIdProviderKey()

    - #### toPath

          public NodePath toPath()