Package org.keycloak.models
Interface GroupModel
-
- All Superinterfaces:
RoleMapperModel
- All Known Subinterfaces:
GroupModel.Streams
public interface GroupModel extends RoleMapperModel
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceGroupModel.GroupRemovedEventstatic classGroupModel.SearchableFieldsstatic interfaceGroupModel.StreamsTheGroupModel.Streamsinterface makes all collection-based methods inGroupModeldefault by providing implementations that delegate to theStream-based variants instead of the other way around.
-
Field Summary
Fields Modifier and Type Field Description static Comparator<GroupModel>COMPARE_BY_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidaddChild(GroupModel subGroup)Automatically calls setParent() on the subGroupList<String>getAttribute(String name)Deprecated.UsegetAttributeStreaminstead.Map<String,List<String>>getAttributes()default Stream<String>getAttributeStream(String name)Returns group attributes that match the given name as a stream.StringgetFirstAttribute(String name)StringgetId()StringgetName()GroupModelgetParent()StringgetParentId()Set<GroupModel>getSubGroups()Deprecated.UsegetSubGroupsStreaminstead.default Stream<GroupModel>getSubGroupsStream()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)voidsetName(String name)voidsetParent(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, getClientRoleMappings, getClientRoleMappingsStream, getRealmRoleMappings, getRealmRoleMappingsStream, getRoleMappings, getRoleMappingsStream, grantRole, hasDirectRole, hasRole
-
-
-
-
Field Detail
-
COMPARE_BY_NAME
static final Comparator<GroupModel> COMPARE_BY_NAME
-
-
Method Detail
-
getId
String getId()
-
getName
String getName()
-
setName
void setName(String name)
-
setSingleAttribute
void setSingleAttribute(String name, String value)
Set single value of specified attribute. Remove all other existing values- Parameters:
name-value-
-
removeAttribute
void removeAttribute(String name)
-
getFirstAttribute
String getFirstAttribute(String name)
- 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
-
getAttribute
@Deprecated List<String> getAttribute(String name)
Deprecated.UsegetAttributeStreaminstead.- Parameters:
name-- Returns:
- list of all attribute values or empty list if there are not any values. Never return null
-
getAttributeStream
default Stream<String> getAttributeStream(String name)
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.
-
getParent
GroupModel getParent()
-
getParentId
String getParentId()
-
getSubGroups
@Deprecated Set<GroupModel> getSubGroups()
Deprecated.UsegetSubGroupsStreaminstead.
-
getSubGroupsStream
default Stream<GroupModel> getSubGroupsStream()
Returns all sub groups for the parent group as a stream.- Returns:
- Stream of
GroupModel. Never returnsnull.
-
setParent
void setParent(GroupModel group)
You must also call addChild on the parent group, addChild on RealmModel if there is no parent group- Parameters:
group-
-
addChild
void addChild(GroupModel subGroup)
Automatically calls setParent() on the subGroup- Parameters:
subGroup-
-
removeChild
void removeChild(GroupModel subGroup)
Automatically calls setParent() on the subGroup- Parameters:
subGroup-
-
-