|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.anasoft.os.daofusion.entity.PersistentEntity<java.lang.Long>
com.anasoft.os.daofusion.entity.MutablePersistentEntity
com.anasoft.os.daofusion.bitemporal.BitemporalWrapper<V>
V
- Value tracked by BitemporalTrace
.public abstract class BitemporalWrapper<V>
Decorates a value with bitemporal information, making it possible to
bitemporally track the value in a BitemporalTrace
. A BitemporalWrapper
allows you to bitemporally track existing value classes, for instance strings. This
class implements the Bitemporal
interface for use with JPA / Hibernate.
Due to the nature of bitemporality, the wrapped value should be immutable.
The value itself will never change, instead new values will be added to the
BitemporalTrace
to represent changes of the value. A BitemporalWrapper
itself is not immutable, its record interval can be ended
.
Instances of this class are serializable if the wrapped value is serializable.
Objects of this class are not thread-safe.
Bitemporal
,
BitemporalTrace
,
Serialized FormField Summary | |
---|---|
static java.lang.String |
_RECORD_FROM
|
static java.lang.String |
_RECORD_TO
|
static java.lang.String |
_VALID_FROM
|
static java.lang.String |
_VALID_TO
|
Fields inherited from class com.anasoft.os.daofusion.entity.PersistentEntity |
---|
_ID |
Constructor Summary | |
---|---|
protected |
BitemporalWrapper()
|
|
BitemporalWrapper(V value,
org.joda.time.Interval validityInterval)
Bitemporally wrap the given value. |
Method Summary | |
---|---|
void |
end()
End the recording interval of this bitemporal object, indicating that it has been superseded by a new object, or is deemed as no longer relevant (i.e. because it was faulty knowledge) and should be "forgotten". |
org.joda.time.Interval |
getRecordInterval()
Returns the interval in which this bitemporal object is known. |
org.joda.time.Interval |
getValidityInterval()
Returns the interval in which this bitemporal object is valid. |
abstract V |
getValue()
Returns the wrapped value, possibly null. |
protected void |
setValidityInterval(org.joda.time.Interval validityInterval)
Set the validity interval for the wrapped value. |
protected abstract void |
setValue(V value)
Set the wrapped value, possibly null. |
java.lang.String |
toString()
|
Methods inherited from class com.anasoft.os.daofusion.entity.MutablePersistentEntity |
---|
clone, getVersion, setVersion |
Methods inherited from class com.anasoft.os.daofusion.entity.PersistentEntity |
---|
getId, setId |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.anasoft.os.daofusion.bitemporal.Bitemporal |
---|
copyWith |
Field Detail |
---|
public static final java.lang.String _VALID_FROM
public static final java.lang.String _VALID_TO
public static final java.lang.String _RECORD_FROM
public static final java.lang.String _RECORD_TO
Constructor Detail |
---|
protected BitemporalWrapper()
public BitemporalWrapper(V value, org.joda.time.Interval validityInterval)
from now on
.
value
- The value to wrap (can be null).validityInterval
- Validity of the value.Method Detail |
---|
protected abstract void setValue(V value)
public abstract V getValue()
public org.joda.time.Interval getValidityInterval()
Bitemporal
getValidityInterval
in interface Bitemporal
Bitemporal.getValidityInterval()
protected void setValidityInterval(org.joda.time.Interval validityInterval)
public org.joda.time.Interval getRecordInterval()
Bitemporal
getRecordInterval
in interface Bitemporal
Bitemporal.getRecordInterval()
public void end()
Bitemporal
end
in interface Bitemporal
Bitemporal.end()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |