Package org.keycloak.models
Interface GroupModel
- All Superinterfaces:
RoleMapperModel
- All Known Implementing Classes:
AbstractGroupModel,GroupAdapter,GroupAdapter,MapGroupAdapter
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfacestatic class -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(GroupModel subGroup) Automatically calls setParent() on the subGroupgetAttributeStream(String name) Returns group attributes that match the given name as a stream.getFirstAttribute(String name) getId()getName()Returns all sub groups for the parent group as a stream.voidremoveAttribute(String name) voidremoveChild(GroupModel subGroup) Automatically calls setParent() on the subGroupvoidsetAttribute(String name, List<String> values) voidvoidsetParent(GroupModel group) You must also call addChild on the parent group, addChild on RealmModel if there is no parent groupvoidsetSingleAttribute(String name, String value) Set single value of specified attribute.Methods inherited from interface org.keycloak.models.RoleMapperModel
deleteRoleMapping, getClientRoleMappingsStream, getRealmRoleMappingsStream, getRoleMappingsStream, grantRole, hasDirectRole, hasRole
-
Field Details
-
COMPARE_BY_NAME
-
-
Method Details
-
getId
String getId() -
getName
String getName() -
setName
-
setSingleAttribute
Set single value of specified attribute. Remove all other existing values- Parameters:
name-value-
-
setAttribute
-
removeAttribute
-
getFirstAttribute
- Parameters:
name-- Returns:
- null if there is not any value of specified attribute or first value otherwise. Don't throw exception if there are more values of the attribute
-
getAttributeStream
Returns group attributes that match the given name as a stream.- Parameters:
name-StringName 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.
-
getAttributes
-
getParent
GroupModel getParent() -
getParentId
String getParentId() -
getSubGroupsStream
Stream<GroupModel> getSubGroupsStream()Returns all sub groups for the parent group as a stream. The stream is sorted by the group name.- Returns:
- Stream of
GroupModel. Never returnsnull.
-
setParent
You must also call addChild on the parent group, addChild on RealmModel if there is no parent group- Parameters:
group-
-
addChild
Automatically calls setParent() on the subGroup- Parameters:
subGroup-
-
removeChild
Automatically calls setParent() on the subGroup- Parameters:
subGroup-
-