Package com.enonic.xp.security

## Class Principals

- java.lang.Object
- - com.enonic.xp.support.AbstractImmutableEntityList<Principal>
  - - com.enonic.xp.security.Principals

- All Implemented Interfaces:
    `Iterable<Principal>`

      @PublicApi
      public final class Principals
      extends AbstractImmutableEntityList<Principal>

- - ### Field Summary

    - ### Fields inherited from class com.enonic.xp.support.AbstractImmutableEntityList

      `list`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static Principals` | `empty()` |
    `static Principals` | `from​(Principal... principals)` |
    `static Principals` | `from​(Iterable<? extends Principal> principals)` |
    `Iterable<Group>` | `getGroups()` |
    `PrincipalKeys` | `getKeys()` |
    `Principal` | `getPrincipal​(PrincipalKey principalKey)` |
    `Iterable<Role>` | `getRoles()` |
    `Iterable<User>` | `getUsers()` |
    `String` | `toString()` |

    - ### Methods inherited from class com.enonic.xp.support.AbstractImmutableEntityList

      `contains, equals, first, get, getList, getSize, hashCode, isEmpty, isNotEmpty, iterator, last, stream`

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

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

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Method Detail

    - #### getKeys

          public PrincipalKeys getKeys()

    - #### getPrincipal

          public Principal getPrincipal​(PrincipalKey principalKey)

    - #### getUsers

          public Iterable<User> getUsers()

    - #### getGroups

          public Iterable<Group> getGroups()

    - #### getRoles

          public Iterable<Role> getRoles()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `AbstractImmutableEntityList<Principal>`

    - #### empty

          public static Principals empty()

    - #### from

          public static Principals from​(Principal... principals)

    - #### from

          public static Principals from​(Iterable<? extends Principal> principals)