Package org.keycloak.userprofile
Class LegacyAttributes
- java.lang.Object
- 
- java.util.AbstractMap<K,V>
- 
- java.util.HashMap<String,List<String>>
- 
- org.keycloak.userprofile.DefaultAttributes
- 
- org.keycloak.userprofile.LegacyAttributes
 
 
 
 
- 
- All Implemented Interfaces:
- Serializable,- Cloneable,- Map<String,List<String>>,- Attributes
 
 public class LegacyAttributes extends DefaultAttributes Enables legacy support when managing attributes without the declarative provider.- Author:
- Pedro Igor
- See Also:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class java.util.AbstractMapAbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
 
- 
 - 
Field Summary- 
Fields inherited from class org.keycloak.userprofile.DefaultAttributescontext, READ_ONLY_ATTRIBUTE_KEY, user
 - 
Fields inherited from interface org.keycloak.userprofile.AttributesEMPTY_VALUE
 
- 
 - 
Constructor SummaryConstructors Constructor Description LegacyAttributes(UserProfileContext context, Map<String,?> attributes, UserModel user, UserProfileMetadata profileMetadata, KeycloakSession session)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,List<String>>getReadable()Returns only the attributes that have read/write permissions.protected booleanisIncludeAttributeIfNotProvided(AttributeMetadata metadata)booleanisReadOnly(String attributeName)Checks whether an attribute is read-only.protected booleanisSupportedAttribute(String name)Checks whether an attribute is support by the profile configuration and the current context.- 
Methods inherited from class org.keycloak.userprofile.DefaultAttributesattributeSet, contains, createAttributeContext, getMetadata, getValues, isReadOnlyFromMetadata, isReadOnlyInternalAttribute, isRequired, nameSet, toMap, validate
 - 
Methods inherited from class java.util.HashMapclear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
 - 
Methods inherited from class java.util.AbstractMapequals, hashCode, toString
 - 
Methods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.keycloak.userprofile.AttributesgetFirstValue, getReadable, isRootAttribute
 
- 
 
- 
- 
- 
Constructor Detail- 
LegacyAttributespublic LegacyAttributes(UserProfileContext context, Map<String,?> attributes, UserModel user, UserProfileMetadata profileMetadata, KeycloakSession session) 
 
- 
 - 
Method Detail- 
isSupportedAttributeprotected boolean isSupportedAttribute(String name) Description copied from class:DefaultAttributesChecks whether an attribute is support by the profile configuration and the current context. This method can be used to avoid unexpected attributes from being added as an attribute because the attribute source is a regular Mapand not normalized.- Overrides:
- isSupportedAttributein class- DefaultAttributes
- Parameters:
- name- the name of the attribute
- Returns:
 
 - 
isReadOnlypublic boolean isReadOnly(String attributeName) Description copied from interface:AttributesChecks whether an attribute is read-only.- Specified by:
- isReadOnlyin interface- Attributes
- Overrides:
- isReadOnlyin class- DefaultAttributes
- Returns:
 
 - 
getReadablepublic Map<String,List<String>> getReadable() Description copied from interface:AttributesReturns only the attributes that have read/write permissions.- Specified by:
- getReadablein interface- Attributes
- Overrides:
- getReadablein class- DefaultAttributes
- Returns:
- the attributes with read/write permission.
 
 - 
isIncludeAttributeIfNotProvidedprotected boolean isIncludeAttributeIfNotProvided(AttributeMetadata metadata) - Overrides:
- isIncludeAttributeIfNotProvidedin class- DefaultAttributes
 
 
- 
 
-