Class SpelledDeltaDate
java.lang.Object
com.aquima.interactions.framework.mask.impl.AbstractMask
com.aquima.interactions.framework.mask.impl.SpelledDeltaDate
- All Implemented Interfaces:
IMask
This mask returns a user friendly representation of the delta of a date with today.
Example when applied to a date:
- 1 day ago
- 6 months ago
- in 3 days
- today
- 1 month and 17 days ago
- 1 year, 2 months and 26 days ago
- in 1 year, 2 months and 26 days
Example when applied to a datetime:
- 1 second ago
- 6 minutes ago
- in 3 hours
- now
- 80 hours, 59 minutes and 37 seconds ago
- Since:
- 7.1
- Author:
- Jon van Leuven
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
applySingleValue
(ISingleValue singleValue, IMaskContext context, ILanguage language) This method is called when this mask is applied.protected DateTimeValue
getNow()
This method may be overridden when an application uses "time traveling".protected DataType[]
Should return the datatypes for which this mask can be applied.Methods inherited from class com.aquima.interactions.framework.mask.impl.AbstractMask
apply
-
Constructor Details
-
SpelledDeltaDate
public SpelledDeltaDate()
-
-
Method Details
-
applySingleValue
protected String applySingleValue(ISingleValue singleValue, IMaskContext context, ILanguage language) throws Exception Description copied from class:AbstractMask
This method is called when this mask is applied.- Specified by:
applySingleValue
in classAbstractMask
- Parameters:
singleValue
- The value, never null and never unknown.context
- Mask contextlanguage
- the language- Returns:
- The applied mask result.
- Throws:
Exception
- When something went wrong.
-
getNow
This method may be overridden when an application uses "time traveling".- Returns:
- The date time representing now.
-
getValidDataTypes
Description copied from class:AbstractMask
Should return the datatypes for which this mask can be applied.- Specified by:
getValidDataTypes
in classAbstractMask
- Returns:
- Array of datatypes.
-