Package com.storedobject.core
Class ComputedDate
java.lang.Object
java.util.Date
java.sql.Date
com.storedobject.core.ComputedDate
- All Implemented Interfaces:
ComputedValue<Date>,Displayable,Storable,Serializable,Cloneable,Comparable<Date>
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionComputedDate(long date) ComputedDate(long date, boolean computed) ComputedDate(ComputedDate date) ComputedDate(Date date) ComputedDate(Date date, boolean computed) -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a copy of thisComputedValueinstance.static ComputedDatebooleanGet the storable value.Retrieves the value object associated with this instance.booleanDetermines whether the current value is in a computed state.voidset(ComputedDate value) voidsetComputed(boolean computed) Sets the computed state of the value.voidSets the value for the current instance.Convert to a displayable string.toString()Methods inherited from class java.sql.Date
getHours, getMinutes, getSeconds, setHours, setMinutes, setSeconds, setTime, toInstant, toLocalDate, valueOf, valueOfMethods inherited from class java.util.Date
after, before, compareTo, from, getDate, getDay, getMonth, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setMonth, setYear, toGMTString, toLocaleString, UTCMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.storedobject.common.ComputedValue
consider, consider, enable, ignore, ignore, isManual, reverseStatus, setManual
-
Constructor Details
-
ComputedDate
public ComputedDate() -
ComputedDate
-
ComputedDate
-
ComputedDate
public ComputedDate(long date) -
ComputedDate
public ComputedDate(long date, boolean computed) -
ComputedDate
-
-
Method Details
-
create
-
set
-
getValueObject
Description copied from interface:ComputedValueRetrieves the value object associated with this instance.- Specified by:
getValueObjectin interfaceComputedValue<Date>- Returns:
- the value object of type
T.
-
setValue
Description copied from interface:ComputedValueSets the value for the current instance. The provided value may be manually set or used in conjunction with the computed state of the object, depending on other methods and logic in the class.- Specified by:
setValuein interfaceComputedValue<Date>- Parameters:
value- the value to be set for the current instance
-
getStorableValue
Description copied from interface:StorableGet the storable value. By default,Object.toString()is returned.- Specified by:
getStorableValuein interfaceStorable- Returns:
- Storable value as a string.
-
isComputed
public boolean isComputed()Description copied from interface:ComputedValueDetermines whether the current value is in a computed state.- Specified by:
isComputedin interfaceComputedValue<Date>- Returns:
trueif the value is computed,falseif it is manually set or not computed.
-
setComputed
public void setComputed(boolean computed) Description copied from interface:ComputedValueSets the computed state of the value.- Specified by:
setComputedin interfaceComputedValue<Date>- Parameters:
computed- iftrue, marks the value as computed; iffalse, marks the value as manually set or non-computed.
-
toString
-
toDisplay
Description copied from interface:DisplayableConvert to a displayable string. The default implementation returns theStringUtility.toStringInt(Object)value.- Specified by:
toDisplayin interfaceDisplayable- Returns:
- A displayable string.
-
equals
-
clone
Description copied from interface:ComputedValueCreates and returns a copy of thisComputedValueinstance. The cloned object is a new instance identical to the original, maintaining the same state and value.- Specified by:
clonein interfaceComputedValue<Date>- Overrides:
clonein classDate- Returns:
- a new
ComputedValue<T>instance that is a copy of the current object
-