Package org.cyclos.impl.utils
Class BaseWithCustomValuesMap
- java.lang.Object
-
- org.cyclos.impl.utils.ConvertingBeanMap
-
- org.cyclos.impl.utils.BaseWithCustomValuesMap
-
- Direct Known Subclasses:
EntityWithCustomValuesMap,ModelWithCustomValuesMap
public abstract class BaseWithCustomValuesMap extends ConvertingBeanMap
Base class for maps which wraps an object which contains custom field values. Properties which are not custom values are accessed via reflection, while custom field values, by field internal name
-
-
Field Summary
Fields Modifier and Type Field Description protected CustomFieldValueHandlercustomFieldValueHandlerprotected Collection<? extends ICustomFieldValue<?,?>>customValuesprotected EntityManagerHandlerentityManagerHandler
-
Constructor Summary
Constructors Constructor Description BaseWithCustomValuesMap(Object bean, Collection<? extends CustomField<?,?,?>> customFields, Collection<? extends ICustomFieldValue<?,?>> customValues, ConversionHandler conversionHandler, EntityManagerHandler entityManagerHandler, CustomFieldValueHandler customFieldValueHandler)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(Object key)Objectget(Object key)CustomField<?,?,?>getCustomField(Long id)CustomField<?,?,?>getCustomField(String internalName)Collection<CustomField<?,?,?>>getCustomFields()protected Set<String>initKeySet()protected abstract ICustomFieldValue<?,?>newCustomFieldValue(CustomField<?,?,?> field)Returns a new instance of a suitableICustomFieldValuefor the given field.Objectput(String name, Object value)-
Methods inherited from class org.cyclos.impl.utils.ConvertingBeanMap
clear, containsValue, entrySet, getBean, getConversionHandler, getPropertyNames, isEmpty, keySet, putAll, remove, size, toString, values
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Field Detail
-
customValues
protected Collection<? extends ICustomFieldValue<?,?>> customValues
-
entityManagerHandler
protected EntityManagerHandler entityManagerHandler
-
customFieldValueHandler
protected CustomFieldValueHandler customFieldValueHandler
-
-
Constructor Detail
-
BaseWithCustomValuesMap
public BaseWithCustomValuesMap(Object bean, Collection<? extends CustomField<?,?,?>> customFields, Collection<? extends ICustomFieldValue<?,?>> customValues, ConversionHandler conversionHandler, EntityManagerHandler entityManagerHandler, CustomFieldValueHandler customFieldValueHandler)
-
-
Method Detail
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<String,Object>- Overrides:
containsKeyin classConvertingBeanMap
-
getCustomField
public CustomField<?,?,?> getCustomField(Long id)
-
getCustomField
public CustomField<?,?,?> getCustomField(String internalName)
-
getCustomFields
public Collection<CustomField<?,?,?>> getCustomFields()
-
initKeySet
protected Set<String> initKeySet()
- Overrides:
initKeySetin classConvertingBeanMap
-
newCustomFieldValue
protected abstract ICustomFieldValue<?,?> newCustomFieldValue(CustomField<?,?,?> field)
Returns a new instance of a suitableICustomFieldValuefor the given field. The returned field value must have both the field and owner (if any) already set in.
-
-