public class DynamicAttributesEntity extends java.lang.Object implements Entity
Instance.BeanPropertyPath, Instance.PropertyChangeEvent, Instance.PropertyChangeListener| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,CategoryAttribute> |
attributesMap |
protected java.util.UUID |
id |
protected BaseGenericIdEntity |
mainItem |
| Constructor and Description |
|---|
DynamicAttributesEntity(BaseGenericIdEntity mainItem,
java.util.Collection<CategoryAttribute> attributes) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(Instance.PropertyChangeListener listener)
Add listener to track attributes changes.
|
java.util.UUID |
getId() |
java.lang.String |
getInstanceName() |
MetaClass |
getMetaClass() |
<T> T |
getValue(java.lang.String name)
Get an attribute value.
|
<T> T |
getValueEx(Instance.BeanPropertyPath propertyPath)
Get an attribute value.
|
<T> T |
getValueEx(java.lang.String propertyPath)
Get an attribute value.
|
void |
removeAllListeners()
Remove all
Instance.PropertyChangeListeners. |
void |
removePropertyChangeListener(Instance.PropertyChangeListener listener)
Remove listener.
|
void |
setValue(java.lang.String name,
java.lang.Object value)
Set an attribute value.
|
void |
setValueEx(Instance.BeanPropertyPath propertyPath,
java.lang.Object value)
Set an attribute value.
|
void |
setValueEx(java.lang.String propertyPath,
java.lang.Object value)
Set an attribute value.
|
protected BaseGenericIdEntity mainItem
protected java.util.UUID id
protected java.util.Map<java.lang.String,CategoryAttribute> attributesMap
public DynamicAttributesEntity(BaseGenericIdEntity mainItem, java.util.Collection<CategoryAttribute> attributes)
public MetaClass getMetaClass()
getMetaClass in interface Instancepublic java.lang.String getInstanceName()
getInstanceName in interface InstanceNamePattern
or toString().public void addPropertyChangeListener(Instance.PropertyChangeListener listener)
InstanceaddPropertyChangeListener in interface Instancelistener - listenerpublic void removePropertyChangeListener(Instance.PropertyChangeListener listener)
InstanceremovePropertyChangeListener in interface Instancelistener - listener to removepublic void removeAllListeners()
InstanceInstance.PropertyChangeListeners.removeAllListeners in interface Instancepublic <T> T getValue(java.lang.String name)
Instancepublic void setValue(java.lang.String name,
java.lang.Object value)
InstanceInstance.PropertyChangeListeners only if the attribute
was actually changed.public <T> T getValueEx(java.lang.String propertyPath)
Instancecar.driver.name.getValueEx in interface InstancepropertyPath - path to an attributeInstance, this method
stops here and returns this value.public void setValueEx(java.lang.String propertyPath,
java.lang.Object value)
Instancecar.driver.name.
car.driver attribute, and if it is not
null and is an Instance, sets value of name attribute in it.
Instance.PropertyChangeListeners only if the attribute
was actually changed.setValueEx in interface InstancepropertyPath - path to an attributevalue - attribute value@Nullable public <T> T getValueEx(Instance.BeanPropertyPath propertyPath)
Instancecar.driver.name.getValueEx in interface InstancepropertyPath - path to an attributeInstance, this method
stops here and returns this value.public void setValueEx(Instance.BeanPropertyPath propertyPath, java.lang.Object value)
Instancecar.driver.name.
car.driver attribute, and if it is not
null and is an Instance, sets value of name attribute in it.
Instance.PropertyChangeListeners only if the attribute
was actually changed.setValueEx in interface InstancepropertyPath - path to an attributevalue - attribute value