org.keycloak.models

## Interface GroupModel.Streams

- All Superinterfaces:
    GroupModel, RoleMapperModel, RoleMapperModel.Streams
  All Known Implementing Classes:
    AbstractGroupModel, GroupAdapter, GroupAdapter, MapGroupAdapter
  Enclosing interface:
    GroupModel

      public static interface GroupModel.Streams
      extends GroupModel, RoleMapperModel.Streams

  The `GroupModel.Streams` interface makes all collection-based methods in `GroupModel` default by providing implementations that delegate to the `Stream`-based variants instead of the other way around.

  It allows for implementations to focus on the `Stream`-based approach for processing sets of data and benefit from the potential memory and performance optimizations of that approach.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.keycloak.models.GroupModel

      `GroupModel.GroupRemovedEvent, GroupModel.SearchableFields, GroupModel.Streams`

  - ### Field Summary

    - ### Fields inherited from interface org.keycloak.models.GroupModel

      `COMPARE_BY_NAME`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default List<String>` | `getAttribute(String name)`
    `Stream<String>` | `getAttributeStream(String name)` Returns group attributes that match the given name as a stream.
    `default Set<GroupModel>` | `getSubGroups()`
    `Stream<GroupModel>` | `getSubGroupsStream()` Returns all sub groups for the parent group as a stream.

    - ### Methods inherited from interface org.keycloak.models.GroupModel

      `addChild, getAttributes, getFirstAttribute, getId, getName, getParent, getParentId, removeAttribute, removeChild, setAttribute, setName, setParent, setSingleAttribute`

    - ### Methods inherited from interface org.keycloak.models.RoleMapperModel.Streams

      `getClientRoleMappings, getClientRoleMappingsStream, getRealmRoleMappings, getRealmRoleMappingsStream, getRoleMappings, getRoleMappingsStream`

    - ### Methods inherited from interface org.keycloak.models.RoleMapperModel

      `deleteRoleMapping, grantRole, hasRole`

- - ### Method Detail

    - #### getAttribute

          default List<String> getAttribute(String name)

      Specified by:
        `getAttribute` in interface `GroupModel`
      Returns:
        list of all attribute values or empty list if there are not any values. Never return null

    - #### getAttributeStream

          Stream<String> getAttributeStream(String name)

      Description copied from interface: `GroupModel`
      Returns group attributes that match the given name as a stream.
      Specified by:
        `getAttributeStream` in interface `GroupModel`
      Parameters:
        `name` - `String` Name of the attribute to be used as a filter.
      Returns:
        Stream of all attribute values or empty stream if there are not any values. Never return `null`.

    - #### getSubGroups

          default Set<GroupModel> getSubGroups()

      Specified by:
        `getSubGroups` in interface `GroupModel`

    - #### getSubGroupsStream

          Stream<GroupModel> getSubGroupsStream()

      Description copied from interface: `GroupModel`
      Returns all sub groups for the parent group as a stream.
      Specified by:
        `getSubGroupsStream` in interface `GroupModel`
      Returns:
        Stream of `GroupModel`. Never returns `null`.

Copyright © 2021 JBoss by Red Hat. All rights reserved.