com.imaginary.lwp
Class Memento
java.lang.Object
|
+--com.imaginary.lwp.Memento
- public class Memento
- extends java.lang.Object
- implements java.io.Serializable
Captures the classic memento pattern for Java. The memento pattern
decouples a business object from its state so that systems like
the lightweight persistence engine can manage storage and retrieval
of an object's state to and from a data store.
Last modified $Date: 1999/10/05 21:43:03 $
- Version:
- $Revision: 1.1.1.1 $
- Author:
- George Reese (borg@imaginary.com)
- See Also:
- Serialized Form
Constructor Summary |
Memento()
Constructs an empty memento. |
Memento(BaseEntity ob)
Constructs a memento for the object with the specified
objectID |
Memento(long oid)
Constructs a memento with the specified objectID . |
Method Summary |
java.lang.Object |
get(java.lang.Class cls,
java.lang.String attr)
Retrieves the value specified by the class and attribute given. |
java.lang.String |
getLastUpdateID()
|
long |
getLastUpdateTime()
|
long |
getObjectID()
|
void |
put(java.lang.Class cls,
java.lang.String attr,
java.lang.Object val)
Inserts the specified value into the memento. |
void |
setLastUpdateID(java.lang.String luid)
|
void |
setLastUpdateTime(long lut)
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Memento
public Memento()
- Constructs an empty memento.
Memento
public Memento(long oid)
- Constructs a memento with the specified
objectID
.
- Parameters:
oid
- the object ID of the object being stored
Memento
public Memento(BaseEntity ob)
- Constructs a memento for the object with the specified
objectID
- Parameters:
oid
- the unique identifier of the object being represented
get
public java.lang.Object get(java.lang.Class cls,
java.lang.String attr)
- Retrieves the value specified by the class and attribute given.
- Parameters:
cls
- the class owning the attributeattr
- the attribute whose value is sought- Returns:
- the value
getLastUpdateID
public java.lang.String getLastUpdateID()
getLastUpdateTime
public long getLastUpdateTime()
getObjectID
public long getObjectID()
- Returns:
- the
objectID
of the object being supported
put
public void put(java.lang.Class cls,
java.lang.String attr,
java.lang.Object val)
- Inserts the specified value into the memento.
- Parameters:
cls
- the class to whom the attribute belongsattr
- the attribute name being storedval
- the value being stored
setLastUpdateID
public void setLastUpdateID(java.lang.String luid)
setLastUpdateTime
public void setLastUpdateTime(long lut)