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 and Description
    --- | ---
    `static Predicate<AttributeContext>` | `ALWAYS_FALSE`
    `static Predicate<AttributeContext>` | `ALWAYS_TRUE`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AttributeMetadata` | `addAnnotations(Map<String,Object> annotations)`
    `AttributeMetadata` | `addValidator(AttributeValidatorMetadata validator)`
    `AttributeMetadata` | `addValidator(List<AttributeValidatorMetadata> validators)`
    `boolean` | `canView(AttributeContext context)`
    `AttributeMetadata` | `clone()`
    `boolean` | `equals(Object o)`
    `Map<String,Object>` | `getAnnotations()`
    `String` | `getName()`
    `List<AttributeValidatorMetadata>` | `getValidators()`
    `int` | `hashCode()`
    `boolean` | `isReadOnly(AttributeContext context)`
    `boolean` | `isRequired(AttributeContext context)` Check if attribute is required based on it's predicate, it is handled as required if predicate is null
    `boolean` | `isSelected(AttributeContext context)`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### 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()

    - #### isSelected

          public boolean isSelected(AttributeContext context)

    - #### isReadOnly

          public boolean isReadOnly(AttributeContext context)

    - #### canView

          public boolean canView(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()

    - #### addValidator

          public AttributeMetadata addValidator(List<AttributeValidatorMetadata> validators)

    - #### addValidator

          public AttributeMetadata addValidator(AttributeValidatorMetadata validator)

    - #### getAnnotations

          public Map<String,Object> getAnnotations()

    - #### addAnnotations

          public AttributeMetadata addAnnotations(Map<String,Object> annotations)

    - #### clone

          public AttributeMetadata clone()

      Overrides:
        `clone` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2021 JBoss by Red Hat. All rights reserved.