public class CompareTimestamps extends ComparatorImpl
MetadataComparisonService
.
Compares two dates using Date.compareTo(Date)
. The result will be the result of that operation as a string so effectively
-1, 0, or 1
.
In the adapter configuration file this class is aliased as metadata-compare-timestamps which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
CompareTimestamps() |
CompareTimestamps(java.lang.String result) |
CompareTimestamps(java.lang.String result,
java.lang.String format) |
Modifier and Type | Method and Description |
---|---|
MetadataElement |
compare(MetadataElement firstItem,
MetadataElement secondItem) |
java.lang.String |
getDateFormat() |
void |
setDateFormat(java.lang.String f)
Set the date format to parse the metadata values.
|
getResultKey, setResultKey
public CompareTimestamps()
public CompareTimestamps(java.lang.String result)
public CompareTimestamps(java.lang.String result, java.lang.String format)
public MetadataElement compare(MetadataElement firstItem, MetadataElement secondItem) throws ServiceException
ServiceException
public java.lang.String getDateFormat()
public void setDateFormat(java.lang.String f)
f
- the dateFormat to set, the default is yyyy-MM-dd'T'HH:mm:ssZ
if not specified.