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.PropertyChangeEvent, Instance.PropertyChangeListener
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() |
addListener, addPropertyChangeListener, getInstanceName, getValueEx, removeAllListeners, removeListener, removePropertyChangeListener, setValue, setValueEx
addListener, addPropertyChangeListener, getInstanceName, getValueEx, removeAllListeners, removeListener, removePropertyChangeListener, setValue, setValueEx
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