|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jalios.jstore.BasicStorable
public class BasicStorable
This class is a convenient super class for any Storable classes. It gets and sets all (non transient) attributs by introspection. It provides getter/setter for store, cdate and mdate. It encapsulated the store id of the object.
| Nested Class Summary | |
|---|---|
static class |
BasicStorable.CdateComparator<T extends Storable>
Compares two Storables using their Cdate in descending order (newest date first). |
static class |
BasicStorable.IdComparator<T extends Storable>
Compares two Storables using their ID. |
static class |
BasicStorable.MdateComparator<T extends Storable>
Compares two Storables using their Mdate in descending order (newest date first). |
| Field Summary | |
|---|---|
protected java.util.Date |
cdate
|
protected java.util.Date |
ddate
|
protected java.lang.String |
id
|
protected java.util.Date |
mdate
|
static java.lang.String |
REVISION
|
protected Store |
store
|
| Constructor Summary | |
|---|---|
BasicStorable()
Creates a new BasicStorable |
|
BasicStorable(BasicStorable other)
Creates a new BasicStorable by cloning |
|
| Method Summary | ||
|---|---|---|
void |
clearId()
Clear the ID of this storable. |
|
java.lang.Object |
clone()
|
|
int |
compareTo(BasicStorable other)
|
|
boolean |
equals(java.lang.Object obj)
|
|
java.lang.String |
getAttribute(java.lang.Object attVal)
Returns a persistent representation of an attribute from its name |
|
java.util.Map<java.lang.String,java.lang.String> |
getAttributes()
Returns a map containing all the attributs of this Storable |
|
java.util.Date |
getCdate()
Get the value of cdate. |
|
static
|
getCdateComparator()
|
|
java.util.Date |
getDdate()
Returns the delete date of this storable. |
|
java.lang.String |
getId()
Get the value of id. |
|
static
|
getIdComparator()
|
|
java.util.Date |
getMdate()
Get the value of mdate. |
|
static
|
getMdateComparator()
|
|
Store |
getStore()
Get the value of store. |
|
java.lang.String |
getUrid()
Returns the URID where this Storable has been created (ie return the urid of this id). |
|
boolean |
hasBeenUpdated()
Check if this storable has been updated |
|
int |
hashCode()
This method return the HashCode of a storable using the storable id's hashcode if id is not null. |
|
boolean |
isStored()
Check if this storable is registered in the store. |
|
java.lang.String |
resolveAtt(java.lang.Object attVal)
This method is called if the type was not resolved by the getAttribute method |
|
java.lang.Object |
resolveVal(java.lang.Class<?> classType,
java.lang.String persistentValue)
This method is called if the type was not resolved by the getValue method |
|
void |
setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
Storable attributes setter |
|
void |
setCdate(java.util.Date v)
Set the value of cdate. |
|
void |
setDdate(java.util.Date ddate)
Sets the delete date of this storable. |
|
void |
setId(java.lang.String v)
Set the value of id. |
|
void |
setMdate(java.util.Date v)
Set the value of mdate. |
|
void |
setStore(Store v)
Set the value of store. |
|
java.lang.String |
toXml()
|
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String REVISION
protected java.util.Date cdate
protected java.util.Date mdate
protected transient java.lang.String id
protected transient Store store
protected transient java.util.Date ddate
| Constructor Detail |
|---|
public BasicStorable()
public BasicStorable(BasicStorable other)
other - the BasicStorable to clone| Method Detail |
|---|
public java.lang.String toXml()
public int hashCode()
hashCode in class java.lang.Objectpublic static <T extends Storable> java.util.Comparator<T> getIdComparator()
public static <T extends Storable> java.util.Comparator<T> getCdateComparator()
public static <T extends Storable> java.util.Comparator<T> getMdateComparator()
public void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
setAttributes in interface Storableattributes - the attributes to set:public java.util.Map<java.lang.String,java.lang.String> getAttributes()
getAttributes in interface Storablepublic java.lang.String getAttribute(java.lang.Object attVal)
getAttribute in interface StorableattVal - the attribute value
public java.lang.String resolveAtt(java.lang.Object attVal)
resolveAtt in interface StorableattVal - the attribute value
public java.lang.Object resolveVal(java.lang.Class<?> classType,
java.lang.String persistentValue)
resolveVal in interface StorableclassType - the class typepersistentValue - the persistent value
public java.lang.Object clone()
clone in interface Storableclone in class java.lang.Objectpublic void clearId()
public boolean hasBeenUpdated()
public java.lang.String getUrid()
public boolean isStored()
public int compareTo(BasicStorable other)
compareTo in interface java.lang.Comparable<BasicStorable>public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String getId()
getId in interface Storablepublic void setId(java.lang.String v)
setId in interface Storablev - Value to assign to id.public Store getStore()
getStore in interface Storablepublic void setStore(Store v)
setStore in interface Storablev - Value to assign to store.public java.util.Date getCdate()
getCdate in interface Storablepublic void setCdate(java.util.Date v)
setCdate in interface Storablev - Value to assign to cdate.public java.util.Date getMdate()
getMdate in interface Storablepublic void setMdate(java.util.Date v)
setMdate in interface Storablev - Value to assign to mdate.public java.util.Date getDdate()
getDdate in interface Storablepublic void setDdate(java.util.Date ddate)
setDdate in interface Storableddate -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||