ise.antelope.tasks
public class DateTimeDifference extends java.lang.Object implements org.apache.tools.ant.taskdefs.condition.Condition
Constructor and Description |
---|
DateTimeDifference() |
Modifier and Type | Method and Description |
---|---|
boolean |
eval() |
void |
setDatetime1(java.lang.String date)
Sets a date/timestamp, required.
|
void |
setDatetime2(java.lang.String date)
Sets the other date/time stamp, required.
|
void |
setFormat(java.lang.String format)
Sets the format of the datetimes, this is a required attribute.
|
void |
setLenient(boolean b)
Sets whether the datetime parser should use lenient parsing.
|
void |
setUnit(java.lang.String unit)
Sets the unit for the difference between the 2 datetimes.
|
void |
setValue(int value)
Sets the expected difference between the 2 datetimes.
|
public void setDatetime1(java.lang.String date)
date
- a string representing a date or time.public void setDatetime2(java.lang.String date)
date
- a string representing a date or time.public void setFormat(java.lang.String format)
format
- The new format valuepublic void setLenient(boolean b)
b
- The new lenient valuepublic void setValue(int value)
value
- the expected difference.public void setUnit(java.lang.String unit)
value
is 12 and unit
is "hours", then this
condition checks that the difference between the 2 datetimes is 12 hours.unit
- valid values are "millisecond", "second", "minute", "hour",
"day", "week", "month", "year".public boolean eval() throws org.apache.tools.ant.BuildException
eval
in interface org.apache.tools.ant.taskdefs.condition.Condition
org.apache.tools.ant.BuildException
- if the attributes are not set correctly