Add millis methods to DateClientParam, #1798
This commit is contained in:
parent
bcac2b061c
commit
37dcf589de
|
@ -137,7 +137,7 @@ public class DateClientParam extends BaseClientParam implements IParam {
|
|||
myPrefix = thePrefix;
|
||||
this.previous = previous;
|
||||
}
|
||||
|
||||
|
||||
public DateWithPrefix(ParamPrefixEnum thePrefix) {
|
||||
myPrefix = thePrefix;
|
||||
}
|
||||
|
@ -176,13 +176,27 @@ public class DateClientParam extends BaseClientParam implements IParam {
|
|||
dt.setPrecision(TemporalPrecisionEnum.SECOND);
|
||||
return constructCriterion(dt);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IDateCriterion millis(Date theValue) {
|
||||
DateTimeDt dt = new DateTimeDt(theValue);
|
||||
dt.setPrecision(TemporalPrecisionEnum.MILLI);
|
||||
return constructCriterion(dt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDateCriterion millis(String theValue) {
|
||||
DateTimeDt dt = new DateTimeDt(theValue);
|
||||
dt.setPrecision(TemporalPrecisionEnum.MILLI);
|
||||
return constructCriterion(dt);
|
||||
}
|
||||
|
||||
private IDateCriterion constructCriterion(DateTimeDt dt) {
|
||||
String valueAsString = dt.getValueAsString();
|
||||
Criterion criterion = new Criterion(myPrefix, valueAsString);
|
||||
if (previous != null) {
|
||||
criterion.orCriterion = previous;
|
||||
}
|
||||
}
|
||||
return criterion;
|
||||
}
|
||||
}
|
||||
|
@ -199,8 +213,12 @@ public class DateClientParam extends BaseClientParam implements IParam {
|
|||
|
||||
IDateCriterion second(String theValue);
|
||||
|
||||
IDateCriterion millis(Date theValue);
|
||||
|
||||
IDateCriterion millis(String theValue);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public interface IDateCriterion extends ICriterion<DateClientParam> {
|
||||
IDateSpecifier orAfter();
|
||||
|
||||
|
|
Loading…
Reference in New Issue