Package org.keycloak.models.map.common
Interface EntityField<E>
- 
- Type Parameters:
- E-
 - All Known Implementing Classes:
- MapAdminEventEntityFields,- MapAuthenticatedClientSessionEntityFields,- MapAuthenticationExecutionEntityFields,- MapAuthenticationFlowEntityFields,- MapAuthenticationSessionEntityFields,- MapAuthenticatorConfigEntityFields,- MapAuthEventEntityFields,- MapClientEntityFields,- MapClientInitialAccessEntityFields,- MapClientScopeEntityFields,- MapComponentEntityFields,- MapGroupEntityFields,- MapIdentityProviderEntityFields,- MapIdentityProviderMapperEntityFields,- MapOTPPolicyEntityFields,- MapPermissionTicketEntityFields,- MapPolicyEntityFields,- MapProtocolMapperEntityFields,- MapRealmEntityFields,- MapRequiredActionProviderEntityFields,- MapRequiredCredentialEntityFields,- MapResourceEntityFields,- MapResourceServerEntityFields,- MapRoleEntityFields,- MapRootAuthenticationSessionEntityFields,- MapScopeEntityFields,- MapSingleUseObjectEntityFields,- MapUserConsentEntityFields,- MapUserCredentialEntityFields,- MapUserEntityFields,- MapUserFederatedIdentityEntityFields,- MapUserLoginFailureEntityFields,- MapUserSessionEntityFields,- MapWebAuthnPolicyEntityFields
 
 public interface EntityField<E>Represents a field in an entity with appropriate accessors.- Author:
- hmlnarik
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> voidcollectionAdd(E e, T value)Adds an element to the collection stored in this field.default <T> ObjectcollectionRemove(E e, T value)Removes an element from the collection stored in this field.Objectget(E e)Returns the value of this field.default Class<?>getCollectionElementClass()default Class<?>getFieldClass()default Class<?>getMapKeyClass()default Class<?>getMapValueClass()StringgetName()Returns name of this field with no spaces where each word starts with a capital letter.StringgetNameCamelCase()StringgetNameDashed()Returns name of this field in lowercase with words separated by a dash (-).default <K> ObjectmapGet(E e, K key)Retrieves a value from the map stored in this field.default <K,T>
 voidmapPut(E e, K key, T value)Adds a mapping to the map stored in this field.default <K> ObjectmapRemove(E e, K key)Removes a mapping from the map stored in this field.default <T> voidset(E e, T value)Sets the value of this field.
 
- 
- 
- 
Method Detail- 
getNameString getName() Returns name of this field with no spaces where each word starts with a capital letter.- Returns:
 
 - 
getNameCamelCaseString getNameCamelCase() 
 - 
getNameDashedString getNameDashed() Returns name of this field in lowercase with words separated by a dash (-).- Returns:
 
 - 
getObject get(E e) Returns the value of this field.- Parameters:
- e- Entity
- Returns:
- Value of the field
 
 - 
setdefault <T> void set(E e, T value) Sets the value of this field. Does nothing by default. If you want to have a field set, override this method.- Type Parameters:
- T-
- Parameters:
- e- Entity
- value- Value of the field
 
 - 
collectionAdddefault <T> void collectionAdd(E e, T value) Adds an element to the collection stored in this field.- Parameters:
- e- Entity
- value- Value to be added to the collection
- Throws:
- ClassCastException- If this field is not a collection.
- UnsupportedOperationException- If this collection type is not yet known.
 
 - 
collectionRemovedefault <T> Object collectionRemove(E e, T value) Removes an element from the collection stored in this field.- Parameters:
- e- Entity
- value- Value to be added to the collection
- Returns:
- Defined by the underlying field. Preferrably it should return deleted object, but it can return
    true / falseindication of removal, or justnull.
- Throws:
- ClassCastException- If this field is not a collection.
 
 - 
mapGetdefault <K> Object mapGet(E e, K key) Retrieves a value from the map stored in this field.- Parameters:
- e- Entity
- key- Requested key
- Returns:
- Object mapped to this key
- Throws:
- ClassCastException- If this field is not a map.
 
 - 
mapPutdefault <K,T> void mapPut(E e, K key, T value) Adds a mapping to the map stored in this field.- Parameters:
- e- Entity
- key- Key to map
- value- Mapped value
- Throws:
- ClassCastException- If this field is not a map.
 
 - 
mapRemovedefault <K> Object mapRemove(E e, K key) Removes a mapping from the map stored in this field.- Parameters:
- e- Entity
- key- Key to remove
- Returns:
- Object mapped to this key
- Throws:
- ClassCastException- If this field is not a map.
 
 - 
getFieldClassdefault Class<?> getFieldClass() - Returns:
- Returns the most specific type of this field.
 
 - 
getCollectionElementClassdefault Class<?> getCollectionElementClass() - Returns:
- If this field is a collection, returns type of its elements; otherwise returns Voidclass.
 
 - 
getMapKeyClassdefault Class<?> getMapKeyClass() - Returns:
- If this field is a map, returns type of its keys; otherwise returns Voidclass.
 
 - 
getMapValueClassdefault Class<?> getMapValueClass() - Returns:
- If this field is a map, returns type of its values; otherwise returns Voidclass.
 
 
- 
 
-