public class KeyValueEntity extends AbstractInstance implements Entity<java.lang.Object>, CubaEnhancingDisabled
KeyValueEntity company = new KeyValueEntity(); company.setValue("email", "info@globex.com"); company.setValue("name", "Globex Corporation"); KeyValueEntity person = new KeyValueEntity(); person.setValue("email", "homer.simpson@mail.com"); person.setValue("firstName", "Homer"); person.setValue("lastName", "Simpson");
Instance.BeanPropertyPath, Instance.PropertyChangeEvent, Instance.PropertyChangeListener
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
idName |
protected MetaClass |
metaClass |
protected java.util.Map<java.lang.String,java.lang.Object> |
properties |
protected java.util.UUID |
uuid |
__propertyChangeListeners, PROPERTY_CHANGE_LISTENERS_INITIAL_CAPACITY
Constructor and Description |
---|
KeyValueEntity() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.lang.Object |
getId() |
java.lang.String |
getIdName() |
MetaClass |
getMetaClass() |
<T> T |
getValue(java.lang.String name)
Get an attribute value.
|
int |
hashCode() |
void |
setId(java.lang.Object id) |
void |
setIdName(java.lang.String idName)
Sets the name of a property that represents this entity id.
|
void |
setMetaClass(MetaClass metaClass)
Sets a meta-class for this entity instance.
|
void |
setValue(java.lang.String name,
java.lang.Object value,
boolean checkEquals)
Set value to property in instance
For internal use only.
|
java.lang.String |
toString() |
addPropertyChangeListener, getInstanceName, getMethodsCache, getRelatedPropertiesCache, getRelatedReadOnlyProperties, getValueEx, getValueEx, propertyChanged, removeAllListeners, removePropertyChangeListener, setValue, setValueEx, setValueEx
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, getInstanceName, getValueEx, getValueEx, removeAllListeners, removePropertyChangeListener, setValue, setValueEx, setValueEx
protected java.util.UUID uuid
protected java.util.Map<java.lang.String,java.lang.Object> properties
protected java.lang.String idName
protected MetaClass metaClass
public MetaClass getMetaClass()
getMetaClass
in interface Instance
public void setMetaClass(MetaClass metaClass)
public java.lang.String getIdName()
setIdName(String)
public void setIdName(java.lang.String idName)
public <T> T getValue(java.lang.String name)
Instance
getValue
in interface Instance
getValue
in class AbstractInstance
name
- attribute name according to JavaBeans notationpublic void setValue(java.lang.String name, java.lang.Object value, boolean checkEquals)
AbstractInstance
AbstractInstance.setValue(String, Object)
setValue
in class AbstractInstance
name
- property namevalue
- valuecheckEquals
- check equals for previous and new value.
If flag is true and objects equals, then setter will not be invokedpublic void setId(java.lang.Object id)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object