|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.beesoft.gaia.util.AbstractBean
eu.beesoft.gaia.util.ValueObject
public class ValueObject
General value object that holds its values as properties in the internal map.
This object has no getters / setters for individual properties, there is one
getProperty(String)
method and one
setProperty(String, Object)
method. The setProperty()
method generates property change event (in parent class AbstractBean
).
Constructor Summary | |
---|---|
ValueObject()
Creates a new value object. |
|
ValueObject(java.lang.Object source)
Creates a new value object for given (data) source object. |
Method Summary | |
---|---|
static java.lang.Long |
createTemporaryId(java.lang.Object object)
Creates a temporary ID for given object. |
boolean |
equals(java.lang.Object object)
Overrides method from java.lang.Object |
java.lang.String |
getClassName()
Gets the class name of the original data object. |
java.lang.Long |
getId()
Returns the ID of this value object. |
java.util.Collection<java.lang.String> |
getNames()
Returns the names of all properties stored in this value object. |
java.lang.Object |
getProperty(java.lang.String name)
Gets property with given name or null if no such property exists. |
int |
hashCode()
Overrides method from java.lang.Object |
boolean |
hasProperty(java.lang.String name)
Checks if this value object holds property with given name. |
static boolean |
isTemporaryId(java.lang.Long id)
Checks if given long matches a temporary ID (see createTemporaryId(Object) ). |
void |
setClassName(java.lang.String className)
Sets the class name of the original data object. |
void |
setId(java.lang.Long id)
Sets the ID of this value object. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Sets property with given name and value. |
Methods inherited from class eu.beesoft.gaia.util.AbstractBean |
---|
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ValueObject()
public ValueObject(java.lang.Object source)
Persistent
, it
gets an ID from it and stores it inside.
source
- - (data) object for this value objectMethod Detail |
---|
public static java.lang.Long createTemporaryId(java.lang.Object object)
object
- - object to compute temporary ID
public static boolean isTemporaryId(java.lang.Long id)
createTemporaryId(Object)
).
id
- - id to check
public java.lang.Long getId()
public void setId(java.lang.Long id)
id
- - id to setpublic java.lang.String getClassName()
public void setClassName(java.lang.String className)
className
- - class name to setpublic java.util.Collection<java.lang.String> getNames()
public boolean hasProperty(java.lang.String name)
name
- - name of the property
public void setProperty(java.lang.String name, java.lang.Object value)
name
- - name of the propertyvalue
- - value of the propertypublic java.lang.Object getProperty(java.lang.String name)
name
- - name of the property
public int hashCode()
java.lang.Object
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)
java.lang.Object
equals
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |