public class BasicStorable extends java.lang.Object implements Storable, java.lang.Comparable<BasicStorable>, java.lang.Cloneable
Modifier and Type | Class and Description |
---|---|
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).
|
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
BasicStorable()
Creates a new BasicStorable
|
BasicStorable(BasicStorable other)
Creates a new BasicStorable by cloning
|
Modifier and Type | Method and Description |
---|---|
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 <T extends Storable> |
getCdateComparator() |
java.util.Date |
getDdate()
Returns the delete date of this storable.
|
java.lang.String |
getId()
Get the value of id.
|
static <T extends Storable> |
getIdComparator() |
java.util.Date |
getMdate()
Get the value of mdate.
|
static <T extends Storable> |
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 |
setAttributes(StorableLogEntry sle)
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() |
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
public BasicStorable()
public BasicStorable(BasicStorable other)
other
- the BasicStorable to clonepublic java.lang.String toXml()
public int hashCode()
hashCode
in class java.lang.Object
public 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)
attributes
- the attributes to set:public void setAttributes(StorableLogEntry sle)
setAttributes
in interface Storable
sle
- the StorableLogEntry that contains the attributes to set:public java.util.Map<java.lang.String,java.lang.String> getAttributes()
getAttributes
in interface Storable
public java.lang.String getAttribute(java.lang.Object attVal)
getAttribute
in interface Storable
attVal
- the attribute valuepublic java.lang.String resolveAtt(java.lang.Object attVal)
resolveAtt
in interface Storable
attVal
- the attribute valuepublic java.lang.Object resolveVal(java.lang.Class<?> classType, java.lang.String persistentValue)
resolveVal
in interface Storable
classType
- the class typepersistentValue
- the persistent valuepublic java.lang.Object clone()
public 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.Object
public java.lang.String getId()
public void setId(java.lang.String v)
public Store getStore()
public void setStore(Store v)
public java.util.Date getCdate()
public void setCdate(java.util.Date v)
public java.util.Date getMdate()
public void setMdate(java.util.Date v)
public java.util.Date getDdate()
Copyright © 2001-2010 Jalios SA. All Rights Reserved.