Package org.keycloak.userprofile
Interface Attributes
- 
- All Known Implementing Classes:
- DefaultAttributes,- LegacyAttributes
 
 public interface AttributesThis interface wraps the attributes associated with a user profile. Different operations are provided to access and manage these attributes. - Author:
- Pedro Igor
 
- 
- 
Field SummaryFields Modifier and Type Field Description static List<String>EMPTY_VALUEDefault value for attributes with no value set.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Set<Map.Entry<String,List<String>>>attributeSet()Returns all attributes defined.booleancontains(String name)Checks whether an attribute with the givennameis defined.default StringgetFirstValue(String name)Returns the first value associated with the attribute with the given .AttributeMetadatagetMetadata(String name)Returns the metadata associated with the attribute with the givenname.Map<String,List<String>>getReadable()Returns only the attributes that have read/write permissions.default Map<String,List<String>>getReadable(boolean includeBuiltin)Similar to {getReadable(boolean)} but with the possibility to add or remove the root attributes.List<String>getValues(String name)Returns all values for an attribute with the givenname.booleanisReadOnly(String key)Checks whether an attribute is read-only.booleanisRequired(String name)Returns whether the attribute with the givennameis required.default booleanisRootAttribute(String name)Returns whether the attribute with the givennameis a root attribute.Set<String>nameSet()Returns the names of all defined attributes.Map<String,List<String>>toMap()booleanvalidate(String name, Consumer<ValidationError>... listeners)Validates the attribute with the givenname.
 
- 
- 
- 
Method Detail- 
getFirstValuedefault String getFirstValue(String name) Returns the first value associated with the attribute with the given .- Parameters:
- name- the name of the attribute
- Returns:
- the first value
 
 - 
getValuesList<String> getValues(String name) Returns all values for an attribute with the givenname.- Parameters:
- name- the name of the attribute
- Returns:
- the attribute values
 
 - 
isReadOnlyboolean isReadOnly(String key) Checks whether an attribute is read-only.- Parameters:
- key-
- Returns:
 
 - 
validateboolean validate(String name, Consumer<ValidationError>... listeners) Validates the attribute with the givenname.- Parameters:
- name- the name of the attribute
- listeners- the listeners for listening for errors.- ValidationError.inputHintcontains name of the attribute in error.
- Returns:
- trueif validation is successful. Otherwise,- false. In case there is no attribute with the given- name,- falseis also returned but without triggering listeners
 
 - 
containsboolean contains(String name) Checks whether an attribute with the givennameis defined.- Parameters:
- name- the name of the attribute
- Returns:
- trueif the attribute is defined. Otherwise,- false
 
 - 
nameSetSet<String> nameSet() Returns the names of all defined attributes.- Returns:
- the set of attribute names
 
 - 
attributeSetSet<Map.Entry<String,List<String>>> attributeSet() Returns all attributes defined.- Returns:
- the attributes
 
 - 
getMetadataAttributeMetadata getMetadata(String name) Returns the metadata associated with the attribute with the given name.The AttributeMetadatais a copy of the original metadata. The original metadata keeps immutable.- Parameters:
- name- the attribute name
- Returns:
- the metadata
 
 - 
isRequiredboolean isRequired(String name) Returns whether the attribute with the givennameis required.- Parameters:
- name- the attribute name
- Returns:
- trueif the attribute is required. Otherwise,- false.
 
 - 
getReadabledefault Map<String,List<String>> getReadable(boolean includeBuiltin) Similar to {getReadable(boolean)} but with the possibility to add or remove the root attributes.- Parameters:
- includeBuiltin- if the root attributes should be included.
- Returns:
- the attributes with read/write permission.
 
 - 
getReadableMap<String,List<String>> getReadable() Returns only the attributes that have read/write permissions.- Returns:
- the attributes with read/write permission.
 
 - 
isRootAttributedefault boolean isRootAttribute(String name) Returns whether the attribute with the givennameis a root attribute.- Parameters:
- name- the attribute name
- Returns:
 
 
- 
 
-