Package org.keycloak.models.map.storage
Class ModelEntityUtil
- java.lang.Object
-
- org.keycloak.models.map.storage.ModelEntityUtil
-
public class ModelEntityUtil extends Object
Utility class covering various aspects of relationship between model and entity classes.- Author:
- hmlnarik
-
-
Constructor Summary
Constructors Constructor Description ModelEntityUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
entityFieldsKnown(Class<?> entityClass)
static <V extends AbstractEntity>
Optional<EntityField<V>>getEntityField(Class<V> entityClass, String fieldNameCamelCase)
static <V> Stream<EntityField<V>>
getEntityFields(Class<V> entityClass)
static <V extends AbstractEntity,M>
Class<V>getEntityType(Class<M> modelClass)
static <V extends AbstractEntity,M>
Class<V>getEntityType(Class<M> modelClass, Class<? extends AbstractEntity> defaultClass)
static <V extends AbstractEntity>
EntityField<V>getIdField(Class<V> targetEntityClass)
static <M> Class<M>
getModelClass(String key)
static String
getModelName(Class<?> key)
static String
getModelName(Class<?> key, String defaultValue)
static Set<String>
getModelNames()
static <V extends AbstractEntity,M>
Class<M>getModelType(Class<V> entityClass)
static <V extends AbstractEntity,M>
Class<M>getModelType(Class<V> entityClass, Class<M> defaultClass)
static <V extends AbstractEntity>
EntityField<V>getRealmIdField(Class<V> targetEntityClass)
static <T extends AbstractEntity & UpdatableEntity>
TsupplyReadOnlyFieldValueIfUnset(T entity, EntityField<T> entityField, Object value)
-
-
-
Method Detail
-
getEntityType
public static <V extends AbstractEntity,M> Class<V> getEntityType(Class<M> modelClass)
-
getEntityType
public static <V extends AbstractEntity,M> Class<V> getEntityType(Class<M> modelClass, Class<? extends AbstractEntity> defaultClass)
-
getModelType
public static <V extends AbstractEntity,M> Class<M> getModelType(Class<V> entityClass)
-
getModelType
public static <V extends AbstractEntity,M> Class<M> getModelType(Class<V> entityClass, Class<M> defaultClass)
-
entityFieldsKnown
public static boolean entityFieldsKnown(Class<?> entityClass)
-
getEntityFields
public static <V> Stream<EntityField<V>> getEntityFields(Class<V> entityClass)
-
getEntityField
public static <V extends AbstractEntity> Optional<EntityField<V>> getEntityField(Class<V> entityClass, String fieldNameCamelCase)
-
getIdField
public static <V extends AbstractEntity> EntityField<V> getIdField(Class<V> targetEntityClass)
-
getRealmIdField
public static <V extends AbstractEntity> EntityField<V> getRealmIdField(Class<V> targetEntityClass)
-
supplyReadOnlyFieldValueIfUnset
public static <T extends AbstractEntity & UpdatableEntity> T supplyReadOnlyFieldValueIfUnset(T entity, EntityField<T> entityField, Object value)
-
-