org.oddjob.beancmpr.comparers
Class DateComparer

java.lang.Object
  extended by org.oddjob.beancmpr.comparers.DateComparer
All Implemented Interfaces:
Comparer<Date>

public class DateComparer
extends Object
implements Comparer<Date>


Constructor Summary
DateComparer()
           
 
Method Summary
 Comparison<Date> compare(Date x, Date y)
          Compare two things.
 String getDateFormat()
           
 long getTolerance()
           
 Class<?> getType()
          The type of the things.
 void setDateFormat(String dateFormat)
           
 void setTolerance(long tolerance)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateComparer

public DateComparer()
Method Detail

getType

public Class<?> getType()
Description copied from interface: Comparer
The type of the things.

Note that we would have liked the return type to be Class<T> but we could not then have had a Comparer<Iterable<MatchableGroup>> because it's not possible to return a type of Class<Iterable<MatchableGroup>> in Java. If there is a solution to this then please let us know.

Specified by:
getType in interface Comparer<Date>
Returns:
The type. Must not be null.

compare

public Comparison<Date> compare(Date x,
                                Date y)
Description copied from interface: Comparer
Compare two things.

Specified by:
compare in interface Comparer<Date>
Parameters:
x - One thing.
y - The other thing.
Returns:
A Comparison. The may be null if either or both of x and y is null.

getTolerance

public long getTolerance()

setTolerance

public void setTolerance(long tolerance)

getDateFormat

public String getDateFormat()

setDateFormat

public void setDateFormat(String dateFormat)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.