public abstract class AbstractComparatorTime extends ComparatorDefault
| Modifier and Type | Field and Description |
|---|---|
static String |
FEATURE_TOLERANCE
Feature to set time tolerance.
|
protected Long |
tolerance
Tolerance for comparisons.
|
| Constructor and Description |
|---|
AbstractComparatorTime() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
compare(Long expected,
Long received)
Compare the expected and received.
|
int |
compare(Object o1,
Object o2) |
protected abstract Long |
getMillis(Object obj)
Get the corresponding time information in milliseconds.
|
Long |
getTolerance()
Get the time tolerance.
|
void |
initialize()
Initialize something.
|
boolean |
match(Object expected,
Object received)
Says if two objects can be considered equals.
|
void |
setTolerance(Long tolerance)
Set time tolerance.
|
getType, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequalspublic static final String FEATURE_TOLERANCE
protected Long tolerance
public void initialize()
IResetableinitialize in interface IResetableinitialize in class ComparatorDefaultpublic Long getTolerance()
public void setTolerance(Long tolerance)
tolerance - The tolerance.public boolean match(Object expected, Object received) throws ComparatorException
IComparatormatch in interface IComparatormatch in class ComparatorDefaultexpected - The expected value.received - The received value.ComparatorException - On comparison errors.protected abstract Long getMillis(Object obj) throws ComparatorException
obj - The time object.ComparatorException - On comparator exceptions.protected boolean compare(Long expected, Long received)
expected - The expected time.received - The received time.public int compare(Object o1, Object o2)
compare in interface Comparator<Object>compare in class ComparatorDefaultCopyright © 2016. All rights reserved.