Package org.keycloak.userprofile
Class AttributeMetadata
- java.lang.Object
-
- org.keycloak.userprofile.AttributeMetadata
-
public final class AttributeMetadata extends Object
- Author:
- Pedro Igor
-
-
Field Summary
Fields Modifier and Type Field Description static Predicate<AttributeContext>
ALWAYS_FALSE
static Predicate<AttributeContext>
ALWAYS_TRUE
-
Method Summary
-
-
-
Field Detail
-
ALWAYS_TRUE
public static final Predicate<AttributeContext> ALWAYS_TRUE
-
ALWAYS_FALSE
public static final Predicate<AttributeContext> ALWAYS_FALSE
-
-
Method Detail
-
getName
public String getName()
-
getGuiOrder
public int getGuiOrder()
-
setGuiOrder
public AttributeMetadata setGuiOrder(int guiOrder)
-
getAttributeGroupMetadata
public AttributeGroupMetadata getAttributeGroupMetadata()
-
isSelected
public boolean isSelected(AttributeContext context)
-
addReadCondition
public AttributeMetadata addReadCondition(Predicate<AttributeContext> readAllowed)
-
addWriteCondition
public AttributeMetadata addWriteCondition(Predicate<AttributeContext> writeAllowed)
-
isReadOnly
public boolean isReadOnly(AttributeContext context)
-
canView
public boolean canView(AttributeContext context)
-
canEdit
public boolean canEdit(AttributeContext context)
-
isRequired
public boolean isRequired(AttributeContext context)
Check if attribute is required based on it's predicate, it is handled as required if predicate is null- Parameters:
context
- to evaluate requirement of the attribute from- Returns:
- true if attribute is required in provided context
-
getValidators
public List<AttributeValidatorMetadata> getValidators()
-
addValidators
public AttributeMetadata addValidators(List<AttributeValidatorMetadata> validators)
-
addAnnotations
public AttributeMetadata addAnnotations(Map<String,Object> annotations)
-
clone
public AttributeMetadata clone()
-
getAttributeDisplayName
public String getAttributeDisplayName()
-
setAttributeDisplayName
public AttributeMetadata setAttributeDisplayName(String attributeDisplayName)
-
setAttributeGroupMetadata
public AttributeMetadata setAttributeGroupMetadata(AttributeGroupMetadata attributeGroupMetadata)
-
setRequired
public AttributeMetadata setRequired(Predicate<AttributeContext> required)
-
setValidators
public AttributeMetadata setValidators(List<AttributeValidatorMetadata> validators)
-
-